mirror of
https://github.com/qdrant/qdrant.git
synced 2026-09-26 07:57:37 -05:00
The `average_vector` recommend strategy folds the examples into one query vector. That fold lived in `collection::recommendations`, though it only touches segment/sparse types (`VectorRef`, `VectorInternal`, `SparseVector::combine_aggregate`, `TypedMultiDenseVector`); edge-based consumers (the serverless search worker) had to re-implement it because the `collection` crate is the whole node layer. Move `avg_vector_for_recommendation` (+ its private `avg_vectors` / `merge_positive_and_negative_avg`) next to `RecoQuery` in `segment::vector_storage::query`, returning `OperationResult` (validation errors map to `CollectionError::BadInput` as before), keep the two collection call sites on it, and re-export it — plus `VectorRef`, needed to call it — from edge. Tests move along, plus one for the fold itself. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>