Bucket aggregation in string terms is too slow

In GlobalOrdinalsStringTermsAggregator

for (long globalTermOrd = 0; globalTermOrd < valueCount; ++globalTermOrd) 

why not loop with bucketOrds,bucketOrds size is much small than valueCount

When there are levels of aggregation, parent agg and valueCount both more than 100 thousands bucket. This situation is very very scary。

Good spot. It looks like the code is designed to cater for both "normal" use and what many might consider to be an edge-case - where min_doc_count is set to zero. In the zero-match scenario the user wants ALL buckets, not just those that matched the query, hence we iterate over all terms.

Can you open an issue?

thanks,i open issue #30117

if min_doc_count = 0 , it seems there is a bug. the search result is wrong

mapping:

tags: {
    type: nested
    name: keyword
    value: keyword
}

my query is

  nested {
       filter {
            terms {
                 reversed_nested {
                     nested {
                          filter {
                              terms {}
                          }
                     }
                 }
            }
       }
  }

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.