oramasearch/orama

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

Closed this issue ยท 6 comments

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

/bounty 75

๐Ÿ’Ž $75 bounty โ€ข OramaSearch

Steps to solve:

  1. Start working: Comment /attempt #730 with your implementation plan
  2. Submit work: Create a pull request including /claim #730 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to askorama/orama!

Add a bounty โ€ข Share on socials

Attempt Started (GMT+0) Solution
๐ŸŸข @abhishek818 Jun 6, 2024, 1:17:42 AM #732
๐ŸŸข @rajeshj11 Jun 6, 2024, 10:31:50 AM #731

/attempt #730

Algora profile Completed bounties Tech Active attempts Options
@abhishek818 4 bounties from 3 projects
JavaScript, TypeScript
Cancel attempt

/attempt #730

Algora profile Completed bounties Tech Active attempts Options
@rajeshj11 4 bounties from 3 projects
JavaScript, TypeScript,
HTML
Cancel attempt

๐Ÿ’ก @rajeshj11 submitted a pull request that claims the bounty. You can visit your bounty board to reward.

๐ŸŽ‰๐ŸŽˆ @rajeshj11 has been awarded $75! ๐ŸŽˆ๐ŸŽŠ