From 51efb6285599eb09b2b0f1d98759839d9a61d39d Mon Sep 17 00:00:00 2001 From: Mohd Shaad Khan <65341373+moshaad7@users.noreply.github.com> Date: Wed, 24 Jul 2024 22:51:02 +0530 Subject: [PATCH] MB-61889: support search with params (#44) * MB-61889: support search with params * Upgrade to bleve_index_api@v1.1.10 --------- Co-authored-by: Abhinav Dangeti --- go.mod | 2 +- go.sum | 4 ++-- segment_vector.go | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 0c6c556..dd7f0ac 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/RoaringBitmap/roaring v1.9.3 - github.com/blevesearch/bleve_index_api v1.1.9 + github.com/blevesearch/bleve_index_api v1.1.10 ) require ( diff --git a/go.sum b/go.sum index 5e8dfb3..05b6a36 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/RoaringBitmap/roaring v1.9.3 h1:t4EbC5qQwnisr5PrP9nt0IRhRTb9gMUgQF4t4 github.com/RoaringBitmap/roaring v1.9.3/go.mod h1:6AXUsoIEzDTFFQCe1RbGA6uFONMhvejWj5rqITANK90= 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.1.9 h1:Cpq0Lp3As0Gfk3+PmcoNDRKeI50C5yuFNpj0YlN/bOE= -github.com/blevesearch/bleve_index_api v1.1.9/go.mod h1:PbcwjIcRmjhGbkS/lJCpfgVSMROV6TRubGGAODaK1W8= +github.com/blevesearch/bleve_index_api v1.1.10 h1:PDLFhVjrjQWr6jCuU7TwlmByQVCSEURADHdCqVS9+g0= +github.com/blevesearch/bleve_index_api v1.1.10/go.mod h1:PbcwjIcRmjhGbkS/lJCpfgVSMROV6TRubGGAODaK1W8= 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 16694c0..3af08e2 100644 --- a/segment_vector.go +++ b/segment_vector.go @@ -18,6 +18,8 @@ package segment import ( + "encoding/json" + "github.com/RoaringBitmap/roaring" ) @@ -55,7 +57,8 @@ type VecPostingsIterator interface { } type VectorIndex interface { - Search(qVector []float32, k int64) (VecPostingsList, error) + // @params: Search params for backing vector index (like IVF, HNSW, etc.) + Search(qVector []float32, k int64, params json.RawMessage) (VecPostingsList, error) Close() Size() uint64 }