Repository navigation
Filter deferred points sparse search - #8299
Conversation
567a56f to
6d8c036
Compare
c761a90 to
b1f3f8b
Compare
c44e937 to
13eeb9e
Compare
b1f3f8b to
097c0b8
Compare
| // Select appropriate last-id by also considering deferred points. | ||
| let max_point = self | ||
| .deferred_internal_id | ||
| .map_or(PointOffsetType::MAX, |defered_id| { |
13eeb9e to
8bfe14a
Compare
IvanPleshkov
left a comment
There was a problem hiding this comment.
Checked code passes:
SparseVectorIndex::search_scored
SparseVectorIndex::search_plain
SparseVectorIndex::search_sparse
SparseVectorIndex::search_nearest_query
SparseVectorIndex::search_query
VectorIndex::search
The deferred point IDs are covered everywhere. Need approval from @agourlay with additional checks on SearchContext changes. From my side, it looks OK, but I'm not 100% sure
| .map_or(PointOffsetType::MAX, |deferred_id| { | ||
| // `for_each_till_id` expects the last ID to be included. | ||
| // Therefore we have to subtract 1. | ||
| deferred_id.saturating_sub(1) |
There was a problem hiding this comment.
If deferred id is equal to Some(0). We're gonna include the first point in the search. I propose to return if the deferred id is zero. In practice, we don't expect such a situation, but we can do it after release for additional safety.
| pooled: PooledScoresHandle<'b>, // handle to pooled scores | ||
| use_pruning: bool, | ||
| hardware_counter: &'a HardwareCounterCell, | ||
| deferred_internal_id: Option<PointOffsetType>, |
There was a problem hiding this comment.
Maybe we can remove SearchContext::deferred_internal_id and patch max_record_id in the constructor. As a result, we may skip all other changes in SearchContext.
For now, it's not critical to fix, let's investigate this thread after release
There was a problem hiding this comment.
To me "max_id" always sounds as if this point itself is included. I couldn't find another term that empathizes the exclusion so I decided to name it 'deferred_internal_id'.
There was a problem hiding this comment.
We can discuss it after the release. As the variant to handle this case, search context creation returns None and the search fallbacks to return nothing
8bfe14a to
ac5706a
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThis pull request introduces support for deferred internal IDs across sparse vector indexing and search operations. The changes replace hardcoded
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
* Implement filtering deferred: Sparse search * Add tests for deferred sparse vectors * Clippy * Review remark
* Implement filtering deferred: Sparse search * Add tests for deferred sparse vectors * Clippy * Review remark
Depends on #8283
Implements efficient filtering of deferred points in sparse vector search.