Hi there,
I am using elasticsearch 7.17 and trying to group result on some field
Here is the query which i am trying to run
GET content-data/_search
{
"_source": false,
"query": {
"bool": {
"should": [
{
"bool": {
"must": [
{
"terms": {
"item_type_number": [
6,
8,
9,
10
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"item_type_number": 1
}
},
{
"terms": {
"cluster_id": [
8
]
}
}
]
}
}
]
}
},
"collapse": {
"field": "section_type",
"inner_hits": {
"name": "sections",
"size": 20,
"sort": [
{
"order_id": {
"order": "ASC"
}
}
]
}
}
}
the issue with this query is that it consumes all of the CPU processing and hence increasing the latency in results. when i run this query with without the field collapse no significant amount of CPU is consumed.
previously i was using term aggregation to group results and retrieve fields but i was facing the same issue and now the collapse field is also becoming the bottleneck.
kindly help me with some mechanism to retrieve the result faster