Cannot change the default indexType from AutoIndex to HNSW when creating an index in the Milvus collection via the RESTful API #38463
Replies: 2 comments
-
@smellthemoon |
Beta Was this translation helpful? Give feedback.
-
It seems that you want to create a specific index when creating a collection. It is not recommended to use the quick create collection method here. If you do not specify the schema parameter, an autoindex will be automatically created for you when creating the collection. This cannot be changed later. You can follow the CUSTOM SETUP WITH INDEX instructions in https://milvus.io/api-reference/restful/v2.5.x/v2/Collection%20(v2)/Create.md, example here `export TOKEN="root:Milvus" curl --request POST |
Beta Was this translation helpful? Give feedback.
-
I have successfully created a Milvus collection and inserted data directly without any noticeable challenges. Now, I want to create a Milvus collection using the RESTful API as detailed in the documentation at Create Collection.
I utilized the following code, which I adapted from the provided link, to create the collection, configure it, insert data, and then create an index.
When I attempted to create the collection using:
I received the following message:
Subsequently, when I described the collection:
I got this response:
When I described the collection index:
I received this message:
This indicated that the index type was set to AUTOINDEX, despite my configuration specifying HNSW, which caused issues with indexing.
Afterwards, I inserted 10,000 rows into the collection:
Finally, when I tried to create the index:
I encountered the following error:
Is it possible for me to set the indexType to HNSW and either ignore or remove the default AutoIndex value?
Update 1
By adjusting the
create_index
function:I encountered the following error:
Beta Was this translation helpful? Give feedback.
All reactions