Skip to content

Commit

Permalink
fix: Pass index type for Scalar indexes
Browse files Browse the repository at this point in the history
Related to milvus-io#694 milvus-io#695

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
  • Loading branch information
congqixia committed Apr 3, 2024
1 parent 6d2bfc9 commit de44939
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion entity/index_scalar.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ type indexScalar struct {
}

func (i *indexScalar) Params() map[string]string {
return map[string]string{}
return map[string]string{
tIndexType: string(i.baseIndex.it),
}
}

func NewScalarIndex() Index {
Expand Down
6 changes: 6 additions & 0 deletions entity/index_scalar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,10 @@ func TestScalarIndex(t *testing.T) {
idxWithType := NewScalarIndexWithType(Sorted)

assert.EqualValues(t, Sorted, idxWithType.IndexType())
assert.EqualValues(t, Sorted, idxWithType.Params()[tIndexType])

idxWithType = NewScalarIndexWithType(Trie)

assert.EqualValues(t, Trie, idxWithType.IndexType())
assert.EqualValues(t, Trie, idxWithType.Params()[tIndexType])
}

0 comments on commit de44939

Please sign in to comment.