Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Neo4j as a search engine

I did several tests and read a lot of cases to use Neo4J for Graph-Based Search. I am convinced by the features as the flexible schema and Real-time search and retrieval. But I also realise it is not designed to store documents to facilitate full-text search. For me the potential of this product is in the business value through data relationships.

The product is matching for 99% with my case: a 'internal google' for the company where I work, except for full-text search on documents (Word, PDF, etc). This is not a hard requirement, but a nice to have. Nevertheless, should I drop the specific Neo4J features and go for a product like Elastic Search or is Neo4J the product we are looking for?

like image 753
Citizen SP Avatar asked Dec 05 '25 14:12

Citizen SP


1 Answers

There are a few options for text search in Neo4j:

Cypher (the Neo4j query language) includes a few string comparison operators: CONTAINS, STARTS WITH and ENDS WITH. For example:

MATCH (d:Document) WHERE d.title STARTS WITH "Graph"
RETURN d

You can also make use of Lucene queries with Neo4j through "legacy" indexes. For example:

START doc=node:node_auto_index("title:graph*")
...

See this post for more information.

You can also model documents as graphs, and query them using Cypher as a graph model. For example, see the Neo4j Doc Manager project for converting data from MongoDB to Neo4j.

Finally, you can also use Neo4j and Elasticsearch together, indexing text data in Elasticsearch and using Neo4j for graph traversals. See this project.

like image 86
William Lyon Avatar answered Dec 08 '25 07:12

William Lyon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!