elasticsearch-xml和“无法派生xcontent”

时间:2015-08-27 14:16:30

标签: xml elasticsearch elasticsearch-plugin

我有以下索引:

curl "localhost:9200/_cat/indices?v"
health status index pri rep docs.count docs.deleted store.size pri.store.size
yellow open   ctrlm   5   1          1            0        3kb            3kb

使用以下代码:

    #conn.request("PUT", "/ctrlm/external/1?pretty", body=r'{"name": "John Doe"}', headers={"Content-type": "application/xml"})
    conn.request("PUT", "/ctrlm/external/1?pretty", body=r'<name>John Doe</name>', headers={"Content-type": "application/xml"})
    r1 = conn.getresponse()
    data1 = r1.read()
    print(r1)
    print(data1)

我最终得到了这个错误:

b'{\r\n  "error" : "MapperParsingException[failed to parse]; nested: ElasticsearchParseException[Failed to derive xcontent]; ",\r\n  "status" : 400\r\n}\n'

请求节点信息:

curl -XGET "http://localhost:9200/_nodes/_all"

我可以看到其他事情:

"plugins":[{"name":"xml-1.6.0.2-c17396e","version":"1.6.0.2","description":"XML plugin","jvm":true,"site":false}]

插件以这种方式安装:

plugin.bat --install xml --url file:C:\Users\id\AppData\Local\Temp\elasticsearch-xml-1.6.0.2-plugin.zip

问题:

在上面,如果我评论XML PUT行并取消注释下面的那个,它可以正常工作。好像我根本无法发送XML。我的xml设置中缺少什么?

0 个答案:

没有答案