下午好!
你可以帮我解决一些错误吗?我有旧版1.3.4的Elasticsearch并安装了插件Carrot2 Clustering插件1.7.0。我将Elasticsearch升级到1.5.0版并插件Carrot2 Clustering插件1.8.0。
现在我正在尝试使用Elasticsearch的插件头在插件carrot2中创建集群。当我在插件头中写POST http://localhost:9200/name_index/_search_with_clusters
{"search_request":{"fields":["message", "url"],"query":{"match":{"_all":"play"}},"size":100},"query_hint":"play","algorithm":"lingo","field_mapping":{"message":["fields.message"], "url":["fields.url"]}}
我得到与结果相似的结果,插件carrot2中的文档示例中对此进行了描述。但是当我尝试在插件carrot2中创建集群时,我得到“没有找到结果”(我尝试了两个不同的索引并且存在相同的情况)
如果我写{"search_request":{"fields":["CONTENT", "url"]....
我没有插入内容的插件头结果,在映射中我有“消息”而不是“内容”。
请你解释一下,这可能是什么错误?
谢谢:)
答案 0 :(得分:0)
我刚刚将ES更新为1.5.1,一切似乎都运行得很好。你能提供一个文件,你的索引和查询不起作用(理想情况下卷曲命令只会导入索引的内容)。
答案 1 :(得分:0)
curl -XPUT 'http://localhost:9200/crypto_test1/message/1/'-d '{"userName":"sirius","message": "Any updates on this? I'd like to offer a 50BTC bounty for implementing bitcoin: URIs in the main client.","id":"62824363619321520123447399604952602615", "url":"https://bitcointalk.org/index.php?topic=5171.0%3Ball"}
curl -XPUT 'http://localhost:9200/crypto_test1/message/2/'-d '{"userName": "sirius","message": "I've started coding this based on Freenet's Library plugin. I'll let you know when I have something that works. Slides from my presentation at Bitcoin Cafe Helsinki: http://www.rvl.io/mmalmi/identifi", "id":"173456646277059498504241103998526335207", "url":"https://bitcointalk.org/index.php?topic=130137.0"}'
curl -XPUT 'http://localhost:9200/crypto_test1/message/3/'-d '{"userName": "Blawpaw","message": "Interview with the Bitcoin Authenticator Development Team http://bitcoinist.net/interview-bitcoin-authenticator-developmentteam/", "id":"132270701711270767638103374518766971434","url":"https://bitcointalk.org/index.php?topic=927838.0"}'
curl -XPUT 'http://localhost:9200/crypto_test1/message/3/'-d '{"userName": "Blawpaw","message": "BitPay Introduces the Bitcore Playground http://bitcoinist.net/bitpay-introduces-bitcore-playground/", "id":"47851523789233207364389394815669084579","url":"https://bitcointalk.org/index.php?topic=956260.0"}'
此查询无效:
{"search_request":{"fields":["message", "url","id","userName"],"query":{"match":"_all":"bitcoin"}},"size":100},"query_hint":"bitcoin","algorithm":"lingo","field_mapping":{"message":["fields.message"], "url":["fields.url"],"userName":["fields.userName"],"id":["fields.id"]}}
它在plugin _head中返回message,userName,id,url,但它不会在插件carrot2中返回结果。
我是否写过您要求的正确查询?
答案 2 :(得分:0)
json_data = json.dumps({
"search_request": {
"_source" : [
"field1"
],
"size": 30
},
"field_mapping": {
"title": ["_source.field1"]
},
"query_hint": "",
"algorithm": "lingo"
})
r = requests.post("http://localhost:9200/esindexName/_search_with_clusters", data=json_data, headers={'Content-Type':'application/json'})
#print(r.text)
clusterList = json.loads(r.text)['clusters']