typesense / typesense/typesense
[Question] found count ignores limit_hits causing broken pagination
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 26.6k
- Forks
- 973
- Avg merge
- 18h 45m
- Merged PRs (30d)
- 4
Description
When using a preset with limit_hits: 20, the search correctly returns 20 items. But the found field in the response still shows 85, which is the total number of matching documents.
This breaks frontend pagination, since it uses found to calculate the number of pages — but the actual accessible results are capped at 20.
Is this expected behavior, or should found also respect the limit_hits cap?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the search with a preset using limit_hits: 20 and compare the returned items with the found value. Identify where the response defines these fields; done means resolving whether found should be capped and documenting or changing the behavior so frontend pagination matches the accessible results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- search
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100