The result of search request has a value of "total", how to disable Elasticsearch to calculate the "hits.total"?
The reason is that we have native script filter which is very heavy, we need to avoid unnecessary calculation.
Result sample:
{
"took": 79,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 2,
"max_score": 0.9581454,
"hits": [
{
"_index": "test",
"_type": "object",
"_id": "001",
"_score": 0.9581454,
"fields": {
"object_name": [
"nested group object"
]
}
}
]
}
}
Query sample:
GET /test/object/_search?pretty=true
{
"size":1,
"query": {
"bool": {
"must": [
{
"match": {
"object_name": "Nested"
}
}
],
"filter": {
"script": {
"script": "nativefilter",
"lang": "native",
"params": {
"user":"user1",
"field": "testfield"
}
}
}
}
},
"fields": ["object_name"]
}