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]: index type not match: expected=Trie, actual=HNSW: invalid parameter #34552

Open
1 task done
0sengseng0 opened this issue Jul 10, 2024 · 1 comment
Open
1 task done
Assignees
Labels
help wanted Extra attention is needed

Comments

@0sengseng0
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Environment

- Milvus version: 2.3.1
- Deployment mode(standalone or cluster):
- MQ type(rocksmq, pulsar or kafka):    
- SDK version(e.g. pymilvus v2.0.0rc2):milvus-sdk-java : 2.4.1
- OS(Ubuntu or CentOS): 
- CPU/Memory: 
- GPU: 
- Others:

Current Behavior

When I created the index, it couldn't execute successfully.

ERROR LOG

io.milvus.v2.exception.MilvusClientException: index type not match: expected=Trie, actual=HNSW: invalid parameter

If I use Trie, it appears:
io.milvus.v2.exception.MilvusClientException: index type not match: expected=Trie, actual=Trie: invalid parameter

Expected Behavior

The index can be created successfully

Steps To Reproduce

@Test
    void createSchemaLocal() {
        MilvusClientV2 client = milvusAutoConfig.getMilvusClientV2();

        CreateCollectionReq.CollectionSchema collectionSchema = client.createSchema();
        collectionSchema.addField(AddFieldReq.builder().fieldName("id").dataType(DataType.Int64).isPrimaryKey(Boolean.TRUE).autoID(Boolean.FALSE).description("id").build());
        collectionSchema.addField(AddFieldReq.builder().fieldName("vector").dataType(DataType.Float16Vector).dimension(1024).build());
        collectionSchema.addField(AddFieldReq.builder().fieldName("user_id").dataType(DataType.VarChar).maxLength(512).isPartitionKey(true).build());
        collectionSchema.addField(AddFieldReq.builder().fieldName("content").dataType(DataType.VarChar).build());

        IndexParam indexParamForVectorField = IndexParam.builder()
                .fieldName("vector")
                .indexType(IndexParam.IndexType.HNSW)
                .metricType(IndexParam.MetricType.IP)
                .build();

        List<IndexParam> indexParams = new ArrayList<>();
        indexParams.add(indexParamForVectorField);

        CreateCollectionReq build = CreateCollectionReq.builder()
                .collectionName("remote_t2")
                .collectionSchema(collectionSchema)
                .indexParams(indexParams)
                .build();

        client.createCollection(build);
}

Milvus Log

No response

Anything else?

No response

@0sengseng0 0sengseng0 added kind/bug Issues or changes related a bug needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jul 10, 2024
@yanliang567
Copy link
Contributor

I believe this was fixed in latest milvus release v2.3.18 and v2.4.5, please retry with the newer sdk version accordingly.
/assign @0sengseng0
/unassign

@yanliang567 yanliang567 added help wanted Extra attention is needed and removed kind/bug Issues or changes related a bug needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
2 participants