Several years we live with es68 and it works fine. But now we want to migrate to es716 and we got problem with queries which contains sort
option inside. For example, we have simple query which returns only one record
GET /someindex/_search
{
"query": {
"bool": {
"filter": [
{
"term": {
"is_category": false
}
},
{
"term": {
"parents": 100500
}
},
{
"term": {
"category_id": 100600
}
}
]
}
},
"size": 1,
"_source": [
"id", "name", "parents"
]
}
in result i got my only one document (it only one exists in es) with took=5ms
{
"took" : 5,
"timed_out" : false,
"_shards" : {
"total" : 10,
"successful" : 10,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 1,
"relation" : "eq"
},
"max_score" : null,
"hits" : [
{
"_index" : "someindex",
"_type" : "somedoctype",
"_id" : "100700",
"_score" : null,
"_source" : {
"id": 100700,
"name": "document name",
"parents": [100400, 100500]
}
}
]
}
}
But if add sort option to query
"sort": {
"keyword_field_name": "asc"
}
i got result, but took-time increase to 70-1000ms
{
"took" : 98,
"timed_out" : false,
"_shards" : {
"total" : 10,
"successful" : 10,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 1,
"relation" : "eq"
},
"max_score" : null,
"hits" : [
{
"_index" : "someindex",
"_type" : "somedoctype",
"_id" : "100700",
"_score" : null,
"_source" : {
"id": 100700,
"name": "document name",
"parents": [100400, 100500]
},
"sort" : [
"name for sorting"
]
}
]
}
}
I see increase execution time for EACH query with sorting inside.
Help me please, how i can to fix it?