Full text search options for MongoDB setup

前端 未结 7 518
陌清茗
陌清茗 2020-12-23 15:03

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

7条回答
  •  时光取名叫无心
    2020-12-23 15:23

    MongoDB can't do efficient full text search. You can do wildcard searches on fields, but i don't think these use indexes efficiently.

    I would recommend using the river functionality of ElasticSearch to automatically push the documents from MongoDB to ElasticSearch.

    elasticsearch-river-mongodb is a MongoDB to Elasticsearch river that when a document changes in MongoDB, ElasticSearch will monitoring the oplog and then automatically update its index.

    This minimises the problem of keeping the two datastores in sync, as ElasticSearch is just monitoring the replication tables of Mongo.

提交回复
热议问题