Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use mongoDB with Solr?

Is it possible to replicate data from mongoDB to Solr? I'm using ruby + sinatra + mongoid. Or i need to make hooks with after_create, after_update and so on through rsolr?

like image 752
Eugene Avatar asked Apr 14 '11 06:04

Eugene


2 Answers

10gen introduced Mongo Connector, which allows to push data into Solr (among others)

http://blog.mongodb.org/post/29127828146/introducing-mongo-connector

From their example:

python mongo_connector.py -m localhost:27217 -t http://localhost:8080/solr
like image 193
Andriy Tkach Avatar answered Sep 21 '22 04:09

Andriy Tkach


Some people integrated Solr with MongoDB with application code listening to the "oplog" of MongoDB. I would recommend implementing something on the application completely decoupled from MongoDB. If you application inserts something into MongoDB then trigger an insertion into Solr etc.

Tailabled cursors might be an option

http://jwage.com/2011/03/16/mongodb-tailable-cursors/

but they only work with capped collections.

like image 26
Andreas Jung Avatar answered Sep 20 '22 04:09

Andreas Jung