Open sandeshkr419 opened 3 months ago
Hi @peternied - keeping these issues separate since the underlying search operations, their code flows and ideas to optimize will be different. They do fall under the aggregation category and there is a probablity that these may share some optimization ideas but for now lets track each of them separately without one being influenced by the other.
Unsure about existing performance of Rare Terms Aggregation at the moment, but looking through initial code at high level, it looks like that this aggregation also utilizes iterating through each document.
The idea is to utilize the terms frequency from Lucene similar to https://github.com/opensearch-project/OpenSearch/pull/11643 and avoid iterating through individual documents.
Next Steps: