diff --git a/entity/index_scalar.go b/entity/index_scalar.go index a8c43a4a..c4ee802f 100644 --- a/entity/index_scalar.go +++ b/entity/index_scalar.go @@ -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 { diff --git a/entity/index_scalar_test.go b/entity/index_scalar_test.go index 4107e8ff..6a2a6809 100644 --- a/entity/index_scalar_test.go +++ b/entity/index_scalar_test.go @@ -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]) }