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
- Observe that the
REST-Content-Rangeresponse indicates a total of300.
Perform another request using:
REST-Range: resources=300-400
- 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.