Full text search options for MongoDB setup

atandon picture atandon · Jun 13, 2012 · Viewed 16.9k times · Source

We are planning to store millions of documents in MongoDB and full text search is very much required. I read Elasticsearch and Solr are the best available solutions for full text search.

  • Is Elastic search is mature enough to be used for Mongodb full text search? We also be sharding the collections. Does Elasticsearch works with Sharded collections?

  • What are the advantages and disadvantages of using Elasticsearch or Solr?

  • Is MongoDB capable of doing full text search?

Answer

Parvin Gasimzade picture Parvin Gasimzade · Jun 13, 2012

There are some search capabilities in MongoDB but it is not as feature-rich as search engines.

http://www.mongodb.org/display/DOCS/Full+Text+Search+in+Mongo

We use Mongo with Solr to make content searchable. We prefer Solr because

  • It is easy to configure and customize
  • It has large community (This is really helpful if you are working with opensource tools)

Since we didn't work with ES i could not say much about it. You can found some discussions about Solr vs ES on the links below.