无法从org.elasticsearch.common.bytes.BytesArray@0派生xcontent

Gov*_*ind 5 elasticsearch

我的卷曲查询有效

curl -v -XGET 'http://localhost:9200/entityitem/5/_mget' -d '{"ids" : ["5000027585", "5000027615"]}'

但是当我使用其余客户端进行GET查询时

http://localhost:9200/entityitem/5/_mget?source={"ids" : ["5000027585", "5000027615"]}

我收到以下错误

无法从org.elasticsearch.common.bytes.BytesArray@0派生xcontent

Dar*_*rby 9

如果你在遵循kibana教程的同时得到这个,你可能会尝试导入shakespeare.json文件.您可能已下载到downloads文件夹并正在另一个文件夹中运行import命令.将输入文件移动到当前目录...

mv ~/Downloads/shakespeare.json .
Run Code Online (Sandbox Code Playgroud)

并运行curl xput命令导入莎士比亚数据.

curl -XPUT localhost:9200/_bulk --data-binary @shakespeare.json 
Run Code Online (Sandbox Code Playgroud)


Ben*_*Lim 0

尝试这个

http://localhost:9200/entityitem/5/_mget?q=ids:5000027585%20OR%20ids:5000027615
Run Code Online (Sandbox Code Playgroud)

q 是查询。ids 是你的字段。上面的URL等于查询

ID:5000027585 或 ID:5000027615

这就是 Elasticsearch 支持的 lucene 语法。记得用%20来代替空格。