terminate_after is not honour when size = 0 and query has aggregations #126665
Labels
:Search Foundations/Search
Catch all for Search Foundations
Team:Search Foundations
Meta label for the Search Foundations team in Elasticsearch
When a query is not collecting hits (size = 0) and contains aggregations, it does not honour the parameter
terminate_after
if defined. There are different incarnations of this bug depending on the value oftrack_total_hits
. The two I have found out are:if
track_total_hits
is false it will never terminate early and will completely ignore theterminate_after
parameter.if
track_total_hits
is true it might collect more documents that the one defined interminate_after
parameter.iff one or more segments fully match the query (we are collecting all doxuments of that segment).
There might more edge cases.
The text was updated successfully, but these errors were encountered: