typesense / typesense/typesense

Feature Request: stopIfEnoughMatches and pagination for multi-index/federated search

Open
#294 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
26.6k
Forks
973
Avg merge
18h 45m
Merged PRs (30d)
4

Description

Description

Would love to have the ability to paginate on multi/federated search without skipping any results. When using algolia, you can do this by passing a strategy of stopIfEnoughMatches:

https://www.algolia.com/doc/api-reference/api-methods/multiple-queries/#method-param-strategy

The request, in pseudo code, would look something like:

Typesense.multi_search({
  strategy: "stopIfEnoughMatches",
  searches: [
    {
      collection: "user_recipes",
      q: query,
      per_page: 20,
      page: page_number,
      query_by: "name",
    },
    {
      collection: "preset_recipes",
      q: query,
      per_page: 20,
      page: page_number,
      query_by: "name",
    }
  ]
})

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

No implementation files or tests are named. Start by reviewing the multi_search API and the linked Algolia stopIfEnoughMatches strategy; done means federated pagination returns results without skipping matches while honoring the requested page and per_page values.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend, search
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.