apoc索引查询中的特殊符号处理
发布于 5 年前 作者 fkissx 1990 次浏览 来自 问答

麻烦求教一下大家:

apoc 全文索引的问题, 已知spoc用的是lucene(http://lucene.apache.org/core/3_5_0/queryparsersyntax.html), 里边提到了特殊符号的处理:

    • && || ! ( ) { } [ ] ^ " ~ * ? :
      前面加\就好了, 但是用apoc.index.node 报错了:

apoc.index.nodes(‘Person’,‘name:ADALIAN JULIE’) 包含空格报错: java.lang.NullPointerException

apoc.index.nodes(‘Person’,‘name::’) 转义: , 报错: Neo.ClientError.Statement.SyntaxError: Invalid input ‘:’: expected ‘’, ‘’’, ‘"’, ‘b’, ‘f’, ‘n’, ‘r’, ‘t’, UTF16 or UTF32

apco.index.search 可以包含这些符号处理, 但是只返回100条不能满足需求, apoc.index.nodes应该怎么去处理这个问题呢?

谢谢~~ 大佬@graphway @zhoujieren64 求救~~

3 回复

apoc.index.nodes 空格这个可以拆开加AND查询 特殊符号呢

@fkissx 没试过,插个眼看看大佬的指导

指定返回数量:

apoc.index.search('name', 'query', [maxNumberOfResults]) YIELD node // 第三个参数可以指定数量

支持短文本试试这个(对应选择节点查询过程):

CALL apoc.index.relationships('关注','headline:"position of Director* "') YIELD rel, start AS startNode, end AS endNode RETURN rel
回到顶部