Problem Description: A field of keyword type causes a shard retrieval failure with differernt size and from value.
Environment:Node-4, Shard-8, Version-8.0
This is my query DSL on Kibana:
POST myIndex/_search
{
"from": 10,
"size": 4,
"timeout": "1m",
"query": {...},
"sort": [
{
"warn_level": {
"order": "desc"
}
},
{
"_score": {
"order": "desc"
}
}
]
}
The sort field 'warn_level' is a field of keyword type, it only has four values ["1", "2", "3", "4"]. And the response result shows:
{
"took" : 281,
"timed_out" : false,
"_shards" : {
"total" : 2,
"successful" : 1,
"skipped" : 0,
"failed" : 1,
"failures" : [
{
"shard" : 5,
"index" : "myIndex",
"node" : "Q3XOTW7gReK2hFI3xVu0bQ",
"reason" : {
"type" : "array_index_out_of_bounds_exception",
"reason" : "Index -1 out of bounds for length 1"
}
}
]
},
"hits" : {
"total" : {
"value" : 0,
"relation" : "eq"
},
"max_score" : null,
"hits" : [ ]
}
}
But sometimes this query DSL is works and no error occurs.
Then I tried to use other keyword type fields to sort, and the same error occurred.
I just want to know what is causing this problem, thanks very much.