【发布时间】:2020-06-17 15:06:22
【问题描述】:
我正在通过 Java 高级 REST 客户端发出 Multi-Get request 并收到以下异常:
“无法解析 Response{requestLine=POST /_mget HTTP/1.1, host=http://localhost:9200, response=HTTP/1.1 200 OK} 的响应正文”
我从发送到 Elastic 的日志中提取了以下 JSON:
{
"docs": [
{
"_index": "blah",
"_type": null,
"_id": "some-id-232332",
"routing": null,
"stored_fields": null,
"version": -3,
"version_type": "internal",
"_source": {
"includes": [],
"excludes": []
}
}
]
}
我通过 Postman 将上述 JSON 发送到 Elastic,我看到以下响应(与我在日志中看到的相同):
{
"docs": [
{
"_index": "blah",
"_type": null,
"_id": "some-id-232332",
"found": false
}
]
}
这不是一个有效的回应吗?这是 elasticsearch-rest-high-level-client 的问题吗?
弹性 7.5.0,org.elasticsearch.client:elasticsearch-rest-high-level-client:7.5.2
【问题讨论】:
-
您能否添加更多详细信息,例如您的请求或您的要求?
-
您能否以 JSON 格式提供您的搜索查询、映射和示例文档,您的 rest-client java 代码,以便我们重现问题并为您提供帮助
-
嗨@OpsterElasticsearchNinja - 我希望避免创建一个简化的示例,因为发布我们的代码有很多不适用的东西。不过,我设法找到了它。我已经创建了一个示例,请查看我的答案。
-
@spottedmahn,将通过它,感谢您跟进此
标签: elasticsearch resthighlevelclient mget