Skip to content

Hybrid search: Missing documents and inaccurate count value with a where clause #730

@nicolastoulemont

Description

@nicolastoulemont

Describe the bug

Using the hybrid search with a where clause and a offset + a limit has two issues:

  • The count value is upperbounded to the limit
  • Some documents are incorrectly not returned.

To Reproduce

You can find a codesandbox with the issue here

More details on the issue on slack here

TLDR: The issue is due to pagination being apply twice with the hybrid search call-stack both on the uniqueTokenScores and within the fetchDocuments function.

Expected behavior

Correct document fetching and correct count values.

Environment Info

OS: MacOS
Node: v20.X

Affected areas

Search

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions