Search code examples
elasticsearchneo4jlucenefull-text-search

Full text search in Neo4j vs Elasticsearch


Both Neo4j 4.0 and Elasticsearch have full text search and an inverted index with Apache Lucene. So how is Elasticsearch better than Neo4j full text search?
Consider that we are dealing with the knowledge graph as a data storage model developed in Neo4j. Apart from that why should we use Elasticsearch with Neo4j 4.0. what are things that Elasticsearch offers but neo4j 4.0 does not?


Solution

  • So how elastic search is better than neo4j full text search?

    "Better" is largely dependent on your use case. But the tools (Neo4j and ElasticSearch) were built for drastically different purposes.

    Neo4j is best when used as a graph-traversal engine, returning data from edge (relationship) based queries. It might have similar capabilities, but it just wasn't meant to be used as a search engine.

    Want things like "fuzzy" matching and relevance ranking? Neo4j is not going to do any of that. Also, ElasticSearch is a true out-of-the-box distributed datastore. Neo4j can't distribute without an enterprise license.

    Basically, it comes down to business requirements. If a datastore mainly needs to execute graph traversals, and serve some simple search-like requests, Neo4j might be enough on its own. Need a full-featured search engine to serve that same data? ElasticSearch is the better suited to handle that.