0

下午好!

你能帮我解决一些错误吗?我有旧版本的 Elasticsearch 1.3.4 并安装了插件 Carrot2 Clustering 插件 1.7.0。我将 Elasticsearch 升级到 1.5.0 版本,插件 Carrot2 Clustering 插件 1.8.0。

现在我正在尝试使用 Elasticsearch 的插件头在插件胡萝卜2 中创建集群。当我写插件头 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"]}}

我得到的结果类似于插件胡萝卜2 文档中的示例中描述的结果。但是当我尝试在插件carrot2中创建集群时,我得到“找不到结果”(我尝试了两个不同的索引并且情况相同)

如果我写的话{"search_request":{"fields":["CONTENT", "url"].... ,我不会得到带有内容的插件头结果,在映射中我有“消息”而不是“内容”。

你能解释一下,这可能是什么错误?

谢谢 :)

4

3 回答 3

0

我刚刚将我的 ES 更新到 1.5.1,一切似乎都运行良好。您能否提供一个包含您的索引和查询但不起作用的文件(理想情况下,curl 命令只会导入索引的内容)。

于 2015-04-10T08:20:32.130 回答
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"]}}

它在插件_head 中返回消息、用户名、id、url,但在插件carrot2 中不返回结果。

我是否写了您要求的正确查询?

于 2015-04-10T16:25:59.013 回答
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']
于 2020-03-20T06:58:05.403 回答