I'm using Neo4j's db.index.fulltext.queryNodes and getting nice results using wildcards. This uses the Lucene 5.5.5 but may not implement all its functionality.
Is there are way to return the specific term that was found within the text being searched? For instance, I search for Sm*th and would like to see Smith or Smyth.
In Neo4j, I created the index on a node property "ancestral_surnames, which is an unstructured string of surnames.
CREATE FULLTEXT INDEX ancestor_surnames_names FOR (n:ancestor_surnames)\n" +
"ON EACH [n.name]
I then search for a surname and the associate DNA_Match node:
CALL db.index.fulltext.queryNodes('ancestor_surnames_names', 'Stinn*tt ') YIELD node, score
WITH score,node.p as match,node.name as anc_names
MATCH (m:DNA_Match{fullname:match})
return distinct m.fullname,match,anc_names order by m.fullname
I get back the full unstructured list of surnames and would like to extract out the term that was found.
Below example is for searching the Movies database. You can do similarly for your node Person.
For Neo4j version 4.2 and below, use syntax below:
OR
Neo4j version 4.3+
Then use * or ? wildcards to query like below.