-
Notifications
You must be signed in to change notification settings - Fork 123
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] OS updates wiping knn_vector field when excluded from _source #1694
Comments
@claire-chiu-figma as you are not storing the _source, the updates will lead to removal of vector. This is not a bug, but this is what removal of _source will happen. and as you can see with the other experiment: when _source is not removed the field is not getting removed. |
We are working on another feature ref: #1571 where if you remove _source and then do updates too the vector field should not be removed. @luyuncheng as you are the author of the PR. can you validate that removing the _source and then doing updates will work once your code is merged? |
@navneet1v Thanks for the quick response -
To further understand the implications of removing a field from |
The reason is there is no way Opensearch has the way to recreate the whole document from scratch. The whole document gets stored in |
I see, and #1571 would help resolve this issue even if the vector is excluded from |
So vectors are already stored in doc_values. What the above PR will do is it will ensure that vectors get pulled from doc values if they are not present in _source. I would like @luyuncheng to comment more as he is author of the PR. |
@navneet1v apart from the PR that's being worked on, are there any other approaches to issuing partial updates without wiping the vector? Or is adding this back to |
@claire-chiu-figma if you can create the whole source back again and use it in your update API that is the only way. Otherwise you have to enable the source. |
@claire-chiu-figma can I go ahead and close this issue. As there is no bug and this is the expected behavior of the Opensearch. |
when excluded from _source and do update operation, it goes to logic: it using lucene source to do update. as i know, in the original reference there is a warning that when exclude source, we can not use and if we wan to use #1571 features, which is rewrite the FetchSubPhase, it can do reindex but not update the other field. there is 2 scenarios:
|
Covered in #1572 |
What is the bug?
I have an index with a knn_vector field that I excluded from _source. When I update a document in this index without specifying any value for the knn_vector field, the field gets wiped from the document (when I would expect the field to remain unchanged).
How can one reproduce the bug?
What is the expected behavior?
I would expect the knn_vector field to still exist after the update, because I have not made any changes to that field.
What is your host/environment?
Opensearch version 2.11, hosted on AWS
Do you have any additional context?
In an index where the knn_vector field (embedding) is NOT excluded from _source, this problem is not present.
The text was updated successfully, but these errors were encountered: