Skip to content

feat: phrase query support using positions data#78

Merged
poyrazK merged 2 commits intomainfrom
feat/inverted-index-and-highlight
Apr 25, 2026
Merged

feat: phrase query support using positions data#78
poyrazK merged 2 commits intomainfrom
feat/inverted-index-and-highlight

Conversation

@poyrazK
Copy link
Copy Markdown
Owner

@poyrazK poyrazK commented Apr 25, 2026

Summary

  • Add SearchQuery::Phrase variant and PhraseQuery struct for phrase matching
  • Implement score_phrase_query that uses positions data to verify consecutive term matches
  • Score based on proximity: exact consecutive = 1.0, gaps decay score
  • Add positions_readers parameter to score_query and score_bool_query to support phrase scoring
  • Handle Phrase variant in validate_query and get_query_terms

Test plan

  • cargo build --workspace --all-targets
  • cargo clippy --workspace --all-targets -- -D warnings -D clippy::pedantic
  • cargo test --workspace --all-targets

Add PhraseQuery struct with field and value for phrase matching.
Add Phrase(PhraseQuery) variant to SearchQuery enum.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 25, 2026

Warning

Rate limit exceeded

@poyrazK has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 33 minutes and 4 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 33 minutes and 4 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5eb3296c-e26f-4236-baaa-75a4b0ca63eb

📥 Commits

Reviewing files that changed from the base of the PR and between cb8d198 and 8db7178.

📒 Files selected for processing (2)
  • rust/crates/cloudsearch-common/src/lib.rs
  • rust/crates/cloudsearch-index/src/lib.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/inverted-index-and-highlight

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

- Add positions_readers parameter to score_query and score_bool_query
- Implement score_phrase_query: verifies consecutive term positions
- Score decays based on gap size between terms (exact = 1.0, gaps < 10 bytes = 1.0, larger gaps decay)
- Add Phrase case to validate_query and get_query_terms
@poyrazK poyrazK force-pushed the feat/inverted-index-and-highlight branch from ca84b17 to 8db7178 Compare April 25, 2026 10:53
Copy link
Copy Markdown
Owner Author

@poyrazK poyrazK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's okay to merge

@poyrazK poyrazK merged commit b217208 into main Apr 25, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant