enabled ALWAYS tracking total hits to avoid 10000 cuts on data count in elastic client

This commit is contained in:
2026-08-10 13:59:34 +02:00
parent 127f5ca287
commit 1e5d0c4517
@@ -261,11 +261,10 @@ async def search(
payload["sort"] = sort
if aggs is not None:
payload["aggs"] = aggs
if track_total_hits:
payload["track_total_hits"] = True
if highlight is not None:
payload["highlight"] = highlight
payload["track_total_hits"] = True # always track total hits for accurate pagination and counts
if len(payload) == 0:
raise ValueError(
"At least one of 'query', 'body', 'source', 'size', 'offset', 'sort', 'aggs' must be provided"