solr Data Import Handlers for MongoDB

2019-01-23 16:00发布

I am working on a project where we have millions of entries stored in MongoDB database and, i want to index all this data using SOLR.

After extensive Searching i came to know there are no proper "Data Import Handlers" for mongoDB database.

Can anyone tell me what are the proper approaches for indexing data in MongoDB using SOLR ?

I want to use all the features of SOLR and want it to be scalable in real-time. I saw one or two approaches from different posts but not sure how they will work real time..

Many Thanks

3条回答
姐就是有狂的资本
2楼-- · 2019-01-23 16:34

10Gen introduce Mongodb Connector. You can integrate Mongodb with Solr using this tool.

Blog post : Introducing Mongo Connector

Github page : mongo-connector

查看更多
兄弟一词,经得起流年.
3楼-- · 2019-01-23 16:37

I wrote a response to a similar question, except it was how to import data from MySQL into SOLR. The example code is in PHP, but should give you a general idea. All you would need to do is set up an iterator to step through your MongoDB assets, extract the data to SOLR datatypes, and then save it to your SOLR index.

If you want it to be real-time, you could add some custom code to the save mechanism (assuming this can be done with MongoDB), and save directly to the SOLR index, then run a commit script to commit data every 15 minutes (via cron).

查看更多
ゆ 、 Hurt°
4楼-- · 2019-01-23 16:54

I have created a plugin to allow you to load data from MongoDb using the Solr data import handler.

Check it out at:

https://github.com/james75/SolrMongoImporter

查看更多
登录 后发表回答