为ES编制索引的MongoDb集合配置河流(Configuration a river for MongoDb collection indexed from ES)

编程入门 行业动态 更新时间:2024-10-27 02:31:04
为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" }

mongo db中的数据位于db:testmongo collection: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,“success”: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 [无法加载值为[mongodb ]]; nested:ClassNotFoundException [mongodb];“,”node“:{”id“:”NrkM50zoS1OX5IajaPdavw“,”name“:”Redsand1“,”transport_address“:”inet [/172.17.0.2:9300]“}} }]}}

请帮助我通过浏览器从MongoDb获取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

最满意答案

这是版本兼容性的问题。 所以我卸载了一切,并使用ES版本1.4.2 Mongo Db版本3.0.6映射附件版本2.4.3 elasticsearch-river-mongodb 2.0.9一切工作正常

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

更多推荐

本文发布于:2023-08-03 13:06:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1390094.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:河流   索引   MongoDb   ES   indexed

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!