Skip to content

Update: Expose matching-document count via X-Adapt-Total header#105

Merged
taylortom merged 1 commit into
masterfrom
update/total-count-header
Jun 11, 2026
Merged

Update: Expose matching-document count via X-Adapt-Total header#105
taylortom merged 1 commit into
masterfrom
update/total-count-header

Conversation

@taylortom

Copy link
Copy Markdown
Collaborator

Update

  • Add an X-Adapt-Total response header to paginated query responses, carrying the total count of documents matching the query (docCount).

The count is already computed in setUpPagination to derive X-Adapt-PageTotal, so this exposes an existing value at no extra cost — it sits alongside the existing X-Adapt-Page / X-Adapt-PageSize / X-Adapt-PageTotal headers.

This lets clients render an accurate "N–M of T" range (and exact arrow disabled-states) instead of inferring an approximate count from pageTotal × pageSize, which over-counts the final page.

Testing

  • Verified setUpPagination still sets the existing headers and the new X-Adapt-Total reflects the matching-document count.

@taylortom taylortom merged commit 3f31d2c into master Jun 11, 2026
2 checks passed
@taylortom taylortom deleted the update/total-count-header branch June 11, 2026 20:12
github-actions Bot pushed a commit that referenced this pull request Jun 11, 2026
# [3.8.0](v3.7.2...v3.8.0) (2026-06-11)

### Update

* Expose matching-document count via X-Adapt-Total header (#105) ([3f31d2c](3f31d2c)), closes [#105](#105)
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 3.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant