Too much time spending on calculating the score in the below queries, I have only used the filters but still, it's calculates the score,
Query:-
{
"from": 0,
"size": 10,
"query": {
"bool": {
"filter": [
{
"range": {
"accountingPeriod": {
"from": null,
"to": "2024_08",
"include_lower": true,
"include_upper": true,
"boost": 1
}
}
},
{
"term": {
"stakeholderId": {
"value": "customer",
"boost": 1
}
}
},
{
"term": {
"currencyTypeId": {
"value": "points",
"boost": 1
}
}
},
{
"term": {
"accountReferenceId": {
"value": "3378295",
"boost": 1
}
}
},
{
"bool": {
"must_not": [
{
"bool": {
"must": [
{
"term": {
"accountingYear": {
"value": 2024,
"boost": 1
}
}
},
{
"term": {
"accountingMonth": {
"value": 10,
"boost": 1
}
}
}
],
"adjust_pure_negative": true,
"boost": 1
}
}
]
}
}
],
"adjust_pure_negative": true,
"boost": 1
}
},
"sort": [
"_doc"
],
"_source": {
"includes": [],
"excludes": []
},
"track_total_hits": 2147483647,
"aggregations": {
"t1": {
"terms": {
"field": "accountId.keyword",
"size": 10,
"min_doc_count": 1,
"shard_min_doc_count": 0,
"show_term_doc_count_error": false,
"order": [
{
"_count": "desc"
},
{
"_key": "asc"
}
]
},
"aggregations": {
"t2": {
"terms": {
"field": "currencyTypeId.keyword",
"size": 10,
"min_doc_count": 1,
"shard_min_doc_count": 0,
"show_term_doc_count_error": false,
"order": [
{
"_count": "desc"
},
{
"_key": "asc"
}
]
},
"aggregations": {
"t3": {
"terms": {
"field": "stakeholderId.keyword",
"size": 10,
"min_doc_count": 1,
"shard_min_doc_count": 0,
"show_term_doc_count_error": false,
"order": [
{
"_count": "desc"
},
{
"_key": "asc"
}
]
},
"aggregations": {
"sum_amount": {
"sum": {
"field": "balance"
}
}
}
}
}
}
}
}
}
}
Query profile:-