typesense / typesense/typesense

[Question] found count ignores limit_hits causing broken pagination

Open
#2,779 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
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?

Image Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.