diff --git a/go.mod b/go.mod index e25589d..01f6c9c 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.24 require ( github.com/RoaringBitmap/roaring/v2 v2.4.5 - github.com/blevesearch/bleve_index_api v1.2.11 + github.com/blevesearch/bleve_index_api v1.2.12-0.20260109154621-f19a6d6af728 ) require ( diff --git a/go.sum b/go.sum index d252f9d..48edeeb 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/RoaringBitmap/roaring/v2 v2.4.5 h1:uGrrMreGjvAtTBobc0g5IrW1D5ldxDQYe2 github.com/RoaringBitmap/roaring/v2 v2.4.5/go.mod h1:FiJcsfkGje/nZBZgCu0ZxCPOKD/hVXDS2dXi7/eUFE0= github.com/bits-and-blooms/bitset v1.12.0 h1:U/q1fAF7xXRhFCrhROzIfffYnu+dlS38vCZtmFVPHmA= github.com/bits-and-blooms/bitset v1.12.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= -github.com/blevesearch/bleve_index_api v1.2.11 h1:bXQ54kVuwP8hdrXUSOnvTQfgK0KI1+f9A0ITJT8tX1s= -github.com/blevesearch/bleve_index_api v1.2.11/go.mod h1:rKQDl4u51uwafZxFrPD1R7xFOwKnzZW7s/LSeK4lgo0= +github.com/blevesearch/bleve_index_api v1.2.12-0.20260109154621-f19a6d6af728 h1:qFnvr+SqVOCbhMl5sVynhuwVkv1yrc7Vhrn8lVdw1nU= +github.com/blevesearch/bleve_index_api v1.2.12-0.20260109154621-f19a6d6af728/go.mod h1:xvd48t5XMeeioWQ5/jZvgLrV98flT2rdvEJ3l/ki4Ko= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/segment_vector.go b/segment_vector.go index 7e50ce4..cf462f3 100644 --- a/segment_vector.go +++ b/segment_vector.go @@ -20,8 +20,8 @@ package segment import ( "encoding/json" - index "github.com/blevesearch/bleve_index_api" "github.com/RoaringBitmap/roaring/v2" + index "github.com/blevesearch/bleve_index_api" ) type VecPostingsList interface { @@ -58,11 +58,18 @@ type VecPostingsIterator interface { } type VectorIndex interface { - // @params: Search params for backing vector index (like IVF, HNSW, etc.) + // Search performs a kNN search for the given query vector and returns a postings list. + // - qVector: the query vector + // - k: the number of similar vectors to return + // - params: additional search parameters Search(qVector []float32, k int64, params json.RawMessage) (VecPostingsList, error) - // @eligibleDocIDs: DocIDs in the segment eligible for the kNN query. - SearchWithFilter(qVector []float32, k int64, eligibleDocIDs []uint64, - params json.RawMessage) (VecPostingsList, error) + // SearchWithFilter performs a kNN search for the given query vector, filtering results based on eligible documents + // - qVector: the query vector + // - k: the number of similar vectors to return + // - eligibleList: list of eligible documents to consider + // - params: additional search parameters + SearchWithFilter(qVector []float32, k int64, eligibleList index.EligibleDocumentList, params json.RawMessage) (VecPostingsList, error) + // Close releases any resources held by the VectorIndex. Close() Size() uint64 @@ -71,8 +78,7 @@ type VectorIndex interface { type VectorSegment interface { Segment - InterpretVectorIndex(field string, requiresFiltering bool, except *roaring.Bitmap) ( - VectorIndex, error) + InterpretVectorIndex(field string, except *roaring.Bitmap) (VectorIndex, error) } type VecPosting interface {