doc_count_error is only relevant when the buckets are sorted in descending _count order (I think this is a documentation gap too, but that's a separate issue https://opensearch.org/docs/latest/aggregations/bucket/terms/). If a different sort order is used then doc_count_error_upper_bound currently shows 0. This can be confusing for users since it implies that there are no candidate buckets being eliminated by shard_size.
Related component
Search:Aggregations
To Reproduce
Example using noaa data from OSB but the underlying data doesn't really matter:
Whenever the doc_count_error cannot be calculated, it either show not be returned in the response body or it should return -1 to differentiate the cases where there is no error vs cases where it cannot be computed.
Additional Details
Plugins
Please list all plugins currently enabled.
Screenshots
If applicable, add screenshots to help explain your problem.
Host/Environment (please complete the following information):
OS: [e.g. iOS]
Version [e.g. 22]
Additional context
Add any other context about the problem here.
Describe the bug
Encountered this as a part of https://github.com/opensearch-project/OpenSearch/pull/11732
doc_count_error
is only relevant when the buckets are sorted in descending_count
order (I think this is a documentation gap too, but that's a separate issue https://opensearch.org/docs/latest/aggregations/bucket/terms/). If a different sort order is used thendoc_count_error_upper_bound
currently shows 0. This can be confusing for users since it implies that there are no candidate buckets being eliminated byshard_size
.Related component
Search:Aggregations
To Reproduce
Example using
noaa
data from OSB but the underlying data doesn't really matter:Expected behavior
Whenever the
doc_count_error
cannot be calculated, it either show not be returned in the response body or it should return -1 to differentiate the cases where there is no error vs cases where it cannot be computed.Additional Details
Plugins Please list all plugins currently enabled.
Screenshots If applicable, add screenshots to help explain your problem.
Host/Environment (please complete the following information):
Additional context Add any other context about the problem here.