Skip to content

Commit

Permalink
updated commentary
Browse files Browse the repository at this point in the history
  • Loading branch information
metonymic-smokey committed Oct 17, 2024
1 parent 90c9497 commit e6259be
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions faiss_vector_posting.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,13 @@ func (sb *SegmentBase) InterpretVectorIndex(field string, requiresFiltering bool

var selector faiss.Selector
var err error
ineligibleVectorIDs := make([]int64, 0, len(vecDocIDMap)-
len(vectorIDsToInclude))
// If there are more elements to be included than excluded, it
// might be quicker to use an exclusion selector as a filter
// instead of an inclusion selector.
if float32(eligibleVecIDsBitmap.GetCardinality())/
float32(len(vecDocIDMap)) > 0.5 {
ineligibleVectorIDs := make([]int64, 0, len(vecDocIDMap)-
len(vectorIDsToInclude))
for docID, vecIDs := range docVecIDMap {
for _, vecID := range vecIDs {
if !eligibleVecIDsBitmap.Contains(uint32(vecID)) &&
Expand Down

0 comments on commit e6259be

Please sign in to comment.