Shruti Srivastava
Shruti Srivastava

Reputation: 398

Configuration a river for MongoDb collection indexed from ES

I am trying to insert data in MongoDb and view it on ES

  > show collections
   person
   system.indexes
  > var p = {firstName: "John", lastName: "Smith"}
  > db.person.save(p)
  WriteResult({ "nInserted" : 1 })
  > db.person.find()
  { "_id" : ObjectId("55e43765b1bf54d157542009"), "firstName" : "John",    "lastName" : "Doe" }
  { "_id" : ObjectId("55e43b7e245babbe4052f55b"), "firstName" : "John", "lastName" : "Smith" }

The data in mongo db is in db : testmongo collection: person

Now , when I do

  curl -XGET 'http://localhost:9200/_river/mongoindex/_search?q=firstName:John'

I get

{"took":2,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}

but on browser when I type

 http://10.130.10.121:9200/_river/_search?pretty

I get

{ "took" : 1, "timed_out" : false, "_shards" : { "total" : 5, "successful" : 5, "failed" : 0 }, "hits" : { "total" : 2, "max_score" : 1.0, "hits" : [ { "_index" : "_river", "_type" : "mongodb", "_id" : "_meta", "_score" : 1.0, "_source":{"type": "mongodb", "mongodb": {"db": "testmongo","collection": "person"},"index": {"name": "mongoindex", "type": "person"}} }, { "_index" : "_river", "_type" : "mongodb", "_id" : "_status", "_score" : 1.0, "_source":{"error":"NoClassSettingsException[Failed to load class with value [mongodb]]; nested: ClassNotFoundException[mongodb]; ","node":{"id":"NrkM50zoS1OX5IajaPdavw","name":"Redsand1","transport_address":"inet[/172.17.0.2:9300]"}} } ] } }

Please help me get proper data in ES index from MongoDb on browser

Thanks

Upvotes: 1

Views: 248

Answers (1)

Shruti Srivastava
Shruti Srivastava

Reputation: 398

It was a problem of version compatibility. So I uninstalled everything and used ES version 1.4.2 Mongo Db version 3.0.6 Mapper attachment version 2.4.3 elasticsearch-river-mongodb 2.0.9 And everything worked fine for me

Upvotes: 0

Related Questions