Neo4j: Lucene phrase matching using Cypher (fuzzy)
In Lucene, a phrase is a group of words surrounded by double quotes, such as "hello dolly". I would like to be able to use 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
It does not mean:
START n=node:node_auto_index("name:\"hella dolly\"~0.1") RETURN n
Splitting the whitespace search phrase into individual 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 a string of type "HelloDolly"
that I would like to successfully match against my "hello dolly"
node.
EDIT:
Some other attempts:
START n=node:node_auto_index("name:hello\\ dolly") RETURN n
----> works (finds my "hello" node but is not fuzzy
START n=node:node_auto_index("name:hello\\ dolly~0.00001") RETURN n
----> doesn't work (finds nothing)
source to share