Skip to content

Commit

Permalink
fix: [2.4] enable mmap for sparse index (#38849)
Browse files Browse the repository at this point in the history
issue: #29419
/kind branch-feature

Signed-off-by: xianliang.li <[email protected]>
  • Loading branch information
foxspy authored Dec 31, 2024
1 parent fb8b880 commit c0e7810
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/util/indexparamcheck/index_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ func IsVectorMmapIndex(indexType IndexType) bool {
indexType == IndexFaissBinIDMap ||
indexType == IndexFaissBinIvfFlat ||
indexType == IndexHNSW ||
indexType == IndexScaNN
indexType == IndexScaNN ||
indexType == IndexSparseInverted ||
indexType == IndexSparseWand
}

func IsDiskIndex(indexType IndexType) bool {
Expand Down
2 changes: 2 additions & 0 deletions pkg/util/indexparamcheck/index_type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ func TestIsScalarMmapIndex(t *testing.T) {
func TestIsVectorMmapIndex(t *testing.T) {
t.Run("vector index", func(t *testing.T) {
assert.True(t, IsVectorMmapIndex(IndexFaissIDMap))
assert.True(t, IsVectorMmapIndex(IndexSparseInverted))
assert.True(t, IsVectorMmapIndex(IndexSparseWand))
assert.False(t, IsVectorMmapIndex(IndexINVERTED))
})
}
Expand Down

0 comments on commit c0e7810

Please sign in to comment.