要不要也来分享分享一下啊

highlevel client(7.10) 查询took>1000时,_shard.successful=0

Elasticsearch | 作者 aiolos | 发布于2021年02月24日 | 阅读数:1628

用highlevel client执行聚合查询时结果异常。观察规律是如果took>1000,返回结果就直接_shard.successful=0
{
"took": 1002,
"timed_out": false,
"terminated_early": false,
"num_reduce_phases": 0,
"_shards": {
"total": 20,
"successful": 0,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 0,
"relation": "gte"
},
"max_score": null,
"hits":
}
}
再次刷新时,又是就可以正常返回
{
"took" : 231,
"timed_out" : false,
"_shards" : {
"total" : 20,
"successful" : 20,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 10000,
"relation" : "gte"
},
"max_score" : null,
"hits" : [ ]
},
"aggregations" : {
"term0" : {
"doc_count" : 8526098,
"countCOUNT_DISTINCTdid" : {
"value" : 3929368
}
}
}
}
下面是client的连接超时的设置,但是感觉好像没什么关系。。
builder.setRequestConfigCallback(requestConfigBuilder -> requestConfigBuilder. setConnectTimeout(-1).setSocketTimeout(-1));
已邀请:

要回复问题请先登录注册