Skip to content

Commit

Permalink
addressed reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
metonymic-smokey committed Nov 29, 2023
1 parent fe3a3bc commit 7a95b25
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions segment_vector.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package segment

import (
"github.com/RoaringBitmap/roaring"
index "github.com/blevesearch/bleve_index_api"
)

type VecPostingsList interface {
Expand Down Expand Up @@ -57,8 +56,8 @@ type VecPostingsIterator interface {

type VectorSegment interface {
Segment
ReadVectorIndex(field string) (index.VectorIndex, error)
SearchSimilarVectors(vecIndex index.VectorIndex, field string, qVector []float32,
GetVectorIndex(field string) (VectorIndex, error)
SearchSimilarVectors(vecIndex VectorIndex, field string, qVector []float32,
k int64, except *roaring.Bitmap) (VecPostingsList, error)
}

Expand All @@ -69,3 +68,11 @@ type VecPosting interface {

Size() int
}

type VectorIndex interface {
// Searches for the top 'k' similar vectors to the ones in 'x'
// Returns the scores and IDs for the similar vectors.
Search(x []float32, k int64) (distances []float32, labels []int64, err error)

Close()
}

0 comments on commit 7a95b25

Please sign in to comment.