-
Notifications
You must be signed in to change notification settings - Fork 2k
improve schema initialization logic and update deprecated code for Milvus vectorstore #3705
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
improve schema initialization logic and update deprecated code for Milvus vectorstore #3705
Conversation
|
@dev-jonghoonpark, could you verify these changes via a test? |
a7971a7 to
81efe0a
Compare
…lvus vectorstore Signed-off-by: jonghoon park <[email protected]>
81efe0a to
1f605cc
Compare
|
Thank you for the feedback. I have added test using the fact that no logs are output when the operation is successful. Before applying the PR, errors occur, so the tests fail. For reference, these logs are not output by Spring AI but rather by the Milvus client internally. The errors are only logged and not thrown. Due to this, I adopted a validation method based on checking the logs. AbstractMilvusGrpcClient.java : } catch (Exception e) {
logError("{} failed! Exception:{}", title, e);
return R.failed(e);
} |
|
@dev-jonghoonpark What did you mean by the following?
How about a more straightforward approach to fix this issue? For example, what if you add the initial Here is what I am thinking. What do you think about that? Also, the Thanks! |
|
The current schema initialization logic works without any issues. As mentioned in the comments, the logs are generated not by Spring AI but by the internal file Therefore, even if describeIndex is wrapped in a try-catch block, unnecessary logs will still be output. Whether |
A collection does not have an index immediately after it is created. Therefore, after calling Line 445 in 1f605cc
I added Line 447 in 1f605cc
to create the index. |
…lvus vectorstore (#3705) Fixes #3705 Signed-off-by: jonghoon park <[email protected]> (cherry picked from commit 5c9891c)
…lvus vectorstore (spring-projects#3705) Fixes spring-projects#3705 Auto-cherry-pick to 1.0.x Signed-off-by: jonghoon park <[email protected]>
…lvus vectorstore (spring-projects#3705) Fixes spring-projects#3705 Auto-cherry-pick to 1.0.x Signed-off-by: jonghoon park <[email protected]>
…lvus vectorstore (spring-projects#3705) Fixes spring-projects#3705 Auto-cherry-pick to 1.0.x Signed-off-by: jonghoon park <[email protected]> Signed-off-by: 家娃 <[email protected]>
changes
improve schema initialization logic
In the current logic, since
createCollectionis executed without following it up withcreateIndex, the following error occurs duringdescribeIndex:However, it is natural for an index to not exist immediately after
createCollection.Thus, the logic was modified to attempt
createIndexright aftercreateCollection.This prevents unnecessary error logs from being recorded.
current example log: https://github.com/spring-projects/spring-ai/actions/runs/15934060747/job/44949781008#step:7:10851
update deprecated code
addFieldTypehas been deprecated.It is recommended to use
withSchemainstead for adding field types, so the implementation has been updated accordingly.