I am running neo4j 3.0.4 and want do a search on the node property using edit distance of 1. I searched the documentation and couldn't find anything, the closest I found was regex search. Any help would be appreciated.
Asked
Active
Viewed 552 times
1 Answers
2
You can use a manual Lucene index, e.g. via the APOC procedure library.
Installation of the library, see: https://github.com/neo4j-contrib/neo4j-apoc-procedures
Documentation: https://neo4j-contrib.github.io/neo4j-apoc-procedures/#_full_text_search
CALL apoc.index.search("locations", "Address.address:Paris~") YIELD node AS addr
MATCH (addr)<-[:HAS_ADDRESS]-(company:Company)
RETURN company LIMIT 50

Michael Hunger
- 41,339
- 3
- 57
- 80
-
This works perfectly, just one step in the installation was missing: I had to manually add this line to the .neo4j.conf file: `dbms.directories.plugins=/Applications/Neo4j\ Community\ Edition.app/Contents/Resources/app/plugins` – Nikhil Aug 30 '16 at 01:03
-
Keep in mind that the full index search returns only the top 100 results, so if the set of nodes you're searching over is above 100, you may not find the expected result set if you're trying to find specific nodes in a pattern. @MichaelHunger Do you know of any way to mitigate this problem? – InverseFalcon Aug 30 '16 at 20:42