在kibana进行查询
GET /indexTest/doc/238801848060
返回结果
{
"_index" : "indexTest",
"_type" : "doc",
"_id" : "238801848060",
"found" : false
}
在java 代码中根据restClient.performRequest方式请求一直返回
org.elasticsearch.client.ResponseException: method [GET], host [...], URI [/indexTest/doc/238801848060], status line [HTTP/1.1 404 Not Found]
{"_index":"indexTest","_type":"doc","_id":"238801848060","found":false}
这种根据_id进行查询为空,没有结果的,不应该走异常处理吧
贴出RestClient部分代码
Response get() throws IOException {
...
} else if (exception instanceof ResponseException) {
throw new ResponseException((ResponseException)exception);
}
...
}
GET /indexTest/doc/238801848060
返回结果
{
"_index" : "indexTest",
"_type" : "doc",
"_id" : "238801848060",
"found" : false
}
在java 代码中根据restClient.performRequest方式请求一直返回
org.elasticsearch.client.ResponseException: method [GET], host [...], URI [/indexTest/doc/238801848060], status line [HTTP/1.1 404 Not Found]
{"_index":"indexTest","_type":"doc","_id":"238801848060","found":false}
这种根据_id进行查询为空,没有结果的,不应该走异常处理吧
贴出RestClient部分代码
Response get() throws IOException {
...
} else if (exception instanceof ResponseException) {
throw new ResponseException((ResponseException)exception);
}
...
}
1 个回复
JiangJibo - 喊我雷锋
赞同来自: