Skip to content

Conversation

@giridhar-se
Copy link
Contributor

Fix: Ensure accurate total hit count in ES7 by adding Elastic search compatibility check

ES7 requires track_total_hits to return accurate hit counts. Older Elastica versions don't support setTrackTotalHits(), resulting in incorrect totals (e.g., showing 10000+ even when more than 30,000 records exist).

This update adds a compatibility check and falls back to manually setting track_total_hits, ensuring accurate counts across versions.

This patch adds a method check and falls back to setting the track_total_hits param, ensuring correct results and backwards compatibility.

@sarah-mason sarah-mason added the Community Pull requests that have been contributed from community members outside Artefactual label Nov 4, 2025
@sarah-mason
Copy link
Contributor

Thank you for your contribution @giridhar-se! I've run the tests on it and am flagging that PHP CS Fixer failed. If you could address this that would be great, thank you. I'll ask the project maintainers to have a look at this PR for any other feedback. Please let us know if you have any questions.

@sarah-mason
Copy link
Contributor

Thanks for the quick update @giridhar-se! I will raise your pull request with the project maintainers asap. In the meantime, if you have not filled out our contributors agreement before, you can do so here and send it to agreement@artefactual.com. Thank you!

@giridhar-se
Copy link
Contributor Author

Thank you Sarah Mason, fixed the issues, now all checks have passed successfully!

Copy link
Contributor

@anvit anvit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for tracking this issue down @giridhar-se ! This change looks good

@anvit anvit merged commit f093cd7 into artefactual:qa/2.x Nov 6, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Community Pull requests that have been contributed from community members outside Artefactual

Projects

None yet

3 participants