简体   繁体   中英

Syncing Elasticsearch with Mongo and Returning Results

I have two questions about using Mongo and Elasticsearch together. My project is integrating Elasticseach along with our existing Mongo data source, however I am having trouble with choosing the best way to sync Elasticsearch with Mongo.

The team doesn't want to use river since it's no longer supported, and their idea is having a cron run and update all the records in Elasticsearch. The issue with that is that the data can be out of sync. The team's solution to this is to do our searches and filtering with Elasticsearch, but then pull the documents from Mongo to ensure they are the most up to date version.

My two questions are: Is there a better way to update Elasticsearch along with MongoDB?

Regardless of the process of which we sync Elasticsearch with Mongo, is it ideal to pull the document from Mongo after Elasticsearch finds them to ensure its the latest version of the document? By doing this do we lose the speed advantage Elasticsearch gives us?

You can use mongodb connector for elastic search and get the real time data in elastic search.

example code mongo-connector -m -a -p -t -d elastic2_doc_manager --auto-commit-interval=0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM