2
votes

I am recently working on integrating ElasticSearch with MongoDB 3.0.

I followed several threads to configure ElasticSearch with MongoDB 3.0 like How to use Elasticsearch with MongoDB?

But, data is not replicated from mongoDB to the ElasticSearch index, ElasticSearch index shows always that it has only one record, although the MongoDB collection has more than 1000 record. All search queries are returning 0 hits.

I can't find new threads talking about MongoDB 3.0, but I followed the Versions compatibility table shown here

https://github.com/richardwilly98/elasticsearch-river-mongodb

I have installed Elastic Search 1.4.2, MongoDB 3.0, River 2.0.9 and AttachmentMapper.

Then I tried to downgrade the MongoDB to 2.6.11 but also the same issue exists.

I am also checking the River admin control page, but it doesn't display anything.

http://localhost:9200/_plugin/river-mongodb/

Why data is not replicating correctly?

1
Hello again, I have tried several versions and followed some steps from github.com/richardwilly98 forums but nothing till this moment. I think the problem is something related with versions incompatibility but i am not sure - Kareem

1 Answers

0
votes

Finally, I have successfully resolved my issue, First, I have downgraded MongoDB to 2.6.6 and River to 2.05 this was my first mistake.

Second,

I was trying to create an index in elasticSearch but I have modified very small part in the url I modified the _river to myindex, which was totally wrong, as you have to add _river to be able to call River.

curl -XPUT localhost:9200/**myindex**/person/_meta -d '{
  "type": "mongodb",
  "mongodb": {
    "servers": [
      { "host": "localhost", "port": 27017 }
    ],
    "db": "newPerson",
    "collection": "Person",
    "options": { "secondary_read_preference": true },
    "gridfs": false
  },
  "index": {
    "name": "mongoindex",
    "type": "person"
  }

}'

Third, the database and collection names were containing upper case letters, which is also was wrong, and after i changed the names to lower case and recreated the index, everything worked fine with me. (try to avoid any capital letters)

Hope that helps,