问题
In Lucene, a Phrase is a group of words surrounded by double quotes such as "hello dolly". I would like to be able to do the CYPHER equivalent of this Lucene fuzzy query:
"hello dolly"~0.1
This finds my "hello dolly"
node:
START n=node:node_auto_index("name:\"hello dolly\"~0.1") RETURN n
This doesn't:
START n=node:node_auto_index("name:\"hella dolly\"~0.1") RETURN n
Splitting the search phrase by whitespace into Single Terms does work:
START n=node:node_auto_index("name:hella~0.1 AND name:dolly~0.1") return n
However, my data might contain string like "HelloDolly"
which I would like to have matched successfully with my "hello dolly"
node.
EDIT:
Some other attempts:
START n=node:node_auto_index("name:hello\\ dolly") RETURN n
----> does work (finds my "hello dolly" node, but is not fuzzy
START n=node:node_auto_index("name:hello\\ dolly~0.00001") RETURN n
----> doesn't work (finds nothing)
回答1:
Try this one:
START n=node:node_auto_index("name:hella\\ dolly~0.1") RETURN n
回答2:
It's an old question but this may help others:
START n=node:node_auto_index('name:"hella dolly"~0.1') RETURN n
来源:https://stackoverflow.com/questions/25553998/neo4j-lucene-phrase-matching-using-cypher-fuzzy