为从 ES 索引的 MongoDb 集合配置一条河流

Configuration a river for MongoDb collection indexed from ES

我正在尝试在 MongoDb 中插入数据并在 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" }

mongodb中的数据在db:testmongocollection:person

现在, 当我做

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

我明白了

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

但是当我在浏览器上输入

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

我明白了

{ "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]"}} } ] } }

请帮助我从 MongoDb 在浏览器

中获取 ES 索引中的正确数据

谢谢

是版本兼容的问题。所以我卸载了所有东西并使用了 ES 版本 1.4.2 Mongo 数据库版本 3.0.6 Mapper 附件版本 2.4.3 elasticsearch-river-mongodb 2.0.9 对我来说一切都很好