You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Throws exception when automatically creating a specified index type that requires some index argument
The reason is that MilvusEmbeddingStore does not support the configuration for additional parameters extraParam when it supports custom index types
For example, an IVF_FLAT index requires the parameter nlist, otherwise the following exception will be thrown when the index is creating
nlist out of range: [1, 65536]
Log and Stack trace
17:12:04.198 [main] ERROR io.milvus.client.AbstractMilvusGrpcClient - CreateIndexRequest collectionName:demo, fieldName:vector failed, error code: 65535, reason: nlist out of range: [1, 65536]
17:12:04.200 [main] ERROR io.milvus.client.AbstractMilvusGrpcClient - CreateIndexRequest collectionName:demo, fieldName:vector failed! Exception:{}
io.milvus.exception.ServerException: nlist out of range: [1, 65536]
at io.milvus.client.AbstractMilvusGrpcClient.handleResponse(AbstractMilvusGrpcClient.java:347)
at io.milvus.client.AbstractMilvusGrpcClient.createIndex(AbstractMilvusGrpcClient.java:1207)
at io.milvus.client.MilvusServiceClient.lambda$createIndex$26(MilvusServiceClient.java:487)
at io.milvus.client.MilvusServiceClient$$Lambda$9/21201513.call(Unknown Source)
at io.milvus.client.MilvusServiceClient.retry(MilvusServiceClient.java:285)
at io.milvus.client.MilvusServiceClient.createIndex(MilvusServiceClient.java:487)
at dev.langchain4j.store.embedding.milvus.CollectionOperationsExecutor.createIndex(CollectionOperationsExecutor.java:93)
at dev.langchain4j.store.embedding.milvus.MilvusEmbeddingStore.(MilvusEmbeddingStore.java:91)
at dev.langchain4j.store.embedding.milvus.MilvusEmbeddingStore$Builder.build(MilvusEmbeddingStore.java:329)
at MilvusTest.main(MilvusTest.java:18)
Exception in thread "main" dev.langchain4j.store.embedding.milvus.RequestToMilvusFailedException: Request to Milvus DB failed. Response status:'65535'.
at dev.langchain4j.store.embedding.milvus.CollectionOperationsExecutor.checkResponseNotFailed(CollectionOperationsExecutor.java:132)
at dev.langchain4j.store.embedding.milvus.CollectionOperationsExecutor.createIndex(CollectionOperationsExecutor.java:94)
at dev.langchain4j.store.embedding.milvus.MilvusEmbeddingStore.(MilvusEmbeddingStore.java:91)
at dev.langchain4j.store.embedding.milvus.MilvusEmbeddingStore$Builder.build(MilvusEmbeddingStore.java:329)
at MilvusTest.main(MilvusTest.java:18)
Caused by: io.milvus.exception.ServerException: nlist out of range: [1, 65536]
at io.milvus.client.AbstractMilvusGrpcClient.handleResponse(AbstractMilvusGrpcClient.java:347)
at io.milvus.client.AbstractMilvusGrpcClient.createIndex(AbstractMilvusGrpcClient.java:1207)
at io.milvus.client.MilvusServiceClient.lambda$createIndex$26(MilvusServiceClient.java:487)
at io.milvus.client.MilvusServiceClient$$Lambda$9/21201513.call(Unknown Source)
at io.milvus.client.MilvusServiceClient.retry(MilvusServiceClient.java:285)
at io.milvus.client.MilvusServiceClient.createIndex(MilvusServiceClient.java:487)
at dev.langchain4j.store.embedding.milvus.CollectionOperationsExecutor.createIndex(CollectionOperationsExecutor.java:93)
... 3 more
Support users to configure the additional parameter extraParam and others that I haven't listed yet
For example, I create the index directly using the milvus client, which supports parameters such as extraParam and syncMode
privatevoid_createIndex(StringcollectionName) {
CreateIndexParamcreateIndexParam = CreateIndexParam.newBuilder()
.withCollectionName(collectionName)
.withFieldName(MilvusConstant.VECTOR_FIELD)
.withIndexType(IndexType.IVF_FLAT)
.withMetricType(MetricType.IP)
// the recommended value of nlist is 4 × sqrt(n), where n is the total number of entities in a segment.
.withExtraParam("{\"nlist\":16384}")
.withSyncMode(Boolean.FALSE)
.build();
R<RpcStatus> response = client.createIndex(createIndexParam);
checkResponse(response);
logger.info("create index success:{}", collectionName);
}
Please complete the following information:
LangChain4j version: 0.2.8
LLM(s) used: none
Java version: 8
Spring Boot version (if applicable):
Additional context
The text was updated successfully, but these errors were encountered:
…uired index parameters
Fix: [langchain4j#860](langchain4j#860)
Added support for configure common custom index parameters
BREAKING CHANGE: The constructor of MilvusEmbeddingStore now require a parameter of type IndexParam.
Describe the bug
Throws exception when automatically creating a specified index type that requires some index argument
The reason is that
MilvusEmbeddingStore
does not support the configuration for additional parametersextraParam
when it supports custom index typesFor example, an IVF_FLAT index requires the parameter
nlist
, otherwise the following exception will be thrown when the index is creatingLog and Stack trace
To Reproduce
Expected behavior
Support users to configure the additional parameter
extraParam
and others that I haven't listed yetFor example, I create the index directly using the milvus client, which supports parameters such as
extraParam
andsyncMode
Please complete the following information:
Additional context
The text was updated successfully, but these errors were encountered: