版本elasticsearch6.0.0,某一个索引有5个分片,在进行如下检索时,检索某些词会出现某个分片报错的情况(不是所有词都报错,只是部分词),经检查发现报错的文档id根本没有存储在该分片上,而是在其他分片上;求大神能不能分析一下。
请求:
错误信息:
请求:
{
"from": 0,
"size": 2,
"query": {
"function_score": {
"query": {
"bool": {
"must": [
{
"multi_match": {
"query": "我知道",
"fields": [
"nickname^1.4",
"summary^1.0",
"title^1.3"
],
"type": "best_fields",
"operator": "OR",
"slop": 0,
"prefix_length": 0,
"max_expansions": 50,
"minimum_should_match": "2<75%",
"lenient": false,
"cutoff_frequency": 0.01,
"zero_terms_query": "NONE",
"boost": 1
}
}
],
"filter": [
{
"term": {
"status": {
"value": 0,
"boost": 1
}
}
}
],
"adjust_pure_negative": true,
"boost": 1
}
},
"functions": [
{
"filter": {
"match_all": {
"boost": 1
}
},
"field_value_factor": {
"field": "reply_count",
"factor": 1,
"missing": 1,
"modifier": "ln2p"
}
}
],
"score_mode": "sum",
"boost_mode": "sum",
"max_boost": 3.4028235e+38,
"boost": 1
}
}
}
错误信息:
{
"took": 13,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 4,
"skipped": 0,
"failed": 1,
"failures": [
{
"shard": 1,
"index": "post_one",
"node": "09elmBYOQ1Sx7084BTTAQw",
"reason": {
"type": "exception",
"reason": "function score query returned an invalid score: NaN for doc: 9117"
}
}
]
},
"hits": {
"total": 20859,
"max_score": 15.510478,
"hits": [
{
………………
}
1 个回复
rochy - rochy_he
赞同来自:
你可以看一下文档id是9117的文档,看它的 reply_count 是否有值