Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Create sparse index with different ways gets different default index name #726

Open
1 task done
ThreadDao opened this issue Apr 17, 2024 · 3 comments
Open
1 task done
Assignees

Comments

@ThreadDao
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

image: master-20240415-fd971a43-amd64
sdk: go-master

  1. create sparse index with entity.NewGenericIndex gets default index name: vector field name
  2. create sparse index with entity.NewIndexSparseInverted gets default index name: SparseInverted
2024/04/17 11:18:05 index_test.go:702: sparseVec SPARSE_INVERTED_INDEX map[drop_ratio_build:0.2 index_type:SPARSE_INVERTED_INDEX metric_type:IP]

2024/04/17 11:18:15 index_test.go:702: SparseInverted SPARSE_INVERTED_INDEX map[index_type:SPARSE_INVERTED_INDEX metric_type:IP params:{"drop_ratio_build":"0.2"}]

case:

func TestCreateIndexSparseVector(t *testing.T) {
	t.Parallel()
	idxInverted := entity.NewGenericIndex(common.DefaultSparseVecFieldName, "SPARSE_INVERTED_INDEX", map[string]string{"drop_ratio_build": "0.2", "metric_type": "IP"})
	idxWand := entity.NewGenericIndex(common.DefaultSparseVecFieldName, "SPARSE_WAND", map[string]string{"drop_ratio_build": "0.3", "metric_type": "IP"})
	idxInverted1, _ := entity.NewIndexSparseInverted(entity.IP, 0.2)
	idxWand1, _ := entity.NewIndexSparseWAND(entity.IP, 0.3)

	for _, idx := range []entity.Index{idxInverted, idxWand, idxInverted1, idxWand1} {
		ctx := createContext(t, time.Second*common.DefaultTimeout)
		//connect
		mc := createMilvusClient(ctx, t)

		// create collection with all datatype
		cp := CollectionParams{CollectionFieldsType: Int64VarcharSparseVec, AutoID: false, EnableDynamicField: true,
			ShardsNum: common.DefaultShards, Dim: common.DefaultDim, MaxLength: 300}
		collName := createCollection(ctx, t, mc, cp)

		// insert
		dp := DataParams{CollectionName: collName, PartitionName: "", CollectionFieldsType: Int64VarcharSparseVec,
			start: 0, nb: common.DefaultNb, dim: common.DefaultDim, EnableDynamicField: true, WithRows: false}
		_, _ = insertData(ctx, t, mc, dp, common.WithSparseVectorLen(100))
		mc.Flush(ctx, collName, false)

		// create index
		err := mc.CreateIndex(ctx, collName, common.DefaultSparseVecFieldName, idx, false)
		common.CheckErr(t, err, true)

		// describe index
		idx2, err := mc.DescribeIndex(ctx, collName, common.DefaultSparseVecFieldName)
		log.Println(idx.Name(), idx.IndexType(), idx.Params())
		log.Println(idx2[0].Name(), idx2[0].IndexType(), idx2[0].Params())
		common.CheckErr(t, err, true)
		common.CheckIndexResult(t, idx2, idx)
	}
}

Expected Behavior

No response

Steps To Reproduce

No response

Environment

No response

Anything else?

No response

@ThreadDao
Copy link
Contributor Author

/assign @congqixia

@siddarth99
Copy link
Contributor

@ThreadDao @congqixia Can I work on this issue if it hasn't been picked yet?

@congqixia
Copy link
Contributor

@siddarth99 sure
/assign @siddarth99
/unassign

@sre-ci-robot sre-ci-robot assigned siddarth99 and unassigned congqixia Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants