Menu
Feedback
Known issues
REST Content-Range Header Shows Incorrect Total When Using Custom Index on Entity
Storage
ID: 1249679
Backlog
Published on10/16/2025
Last updated on10/16/2025
1 min read

Summary

When querying documents using a custom index as a filter and the REST-Range header (e.g., resources=0-100), the response's REST-Content-Range header returns an incorrect total of resources (e.g., 300). However, querying with a higher range (e.g., resources=300-400) reveals that the actual total is larger. This happens because the query uses a custom index instead of the indexer.

Simulation

Perform a search with the custom index as a filter on an entity that has more than 300 documents with the header:

REST-Range: resources=0-100

  1. Observe that the REST-Content-Range response indicates a total of 300.

Perform another request using:

REST-Range: resources=300-400

  1. Observe that documents continue to return, indicating the real total is more than 300.

Workaround

Remove the custom index. This will force the application to query the indexer directly, which correctly returns the total count.

Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
On this page
Still got questions?
Ask the community
Find solutions and share ideas in the VTEX Community
Join our community
Request VTEX support
For personalized assistance, contact our experts
Open a support ticket
GitHubDeveloper PortalCommunityFeedback