{"section":"known-issues","requestedLocale":"en","requestedSlug":"rest-contentrange-header-shows-incorrect-total-when-using-custom-index-on-entity","locale":"en","slug":"rest-contentrange-header-shows-incorrect-total-when-using-custom-index-on-entity","path":"docs/en/known-issues/Storage/rest-contentrange-header-shows-incorrect-total-when-using-custom-index-on-entity.md","branch":"main","content":"## Summary\n\n\nWhen 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.\n\n\n#### Simulation\n\n\n\n1.\n\nPerform a search with the custom index as a filter on an entity that has more than 300 documents with the header:\n\n    REST-Range: resources=0-100\n\n2. Observe that the `REST-Content-Range` response indicates a total of `300`.\n3.\n\nPerform another request using:\n\n    REST-Range: resources=300-400\n\n4. Observe that documents continue to return, indicating the real total is more than 300.\n\n\n#### Workaround\n\n\nRemove the custom index. This will force the application to query the indexer directly, which correctly returns the total count."}