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
What is the expected behavior?
Should raise an exception that either model id or dimension should be provided. When model id is provided, k-NN refer dimension from training index instead of user defined dimension in mapping request body.
What is your host/environment?
N/A
Do you have any screenshots?
N/A
Do you have any additional context?
N/A
The text was updated successfully, but these errors were encountered:
While adding validation we should also add version check to make sure that validation is applicable only for indices that are created after validation check is added. Without version check, when index is upgraded from old version, it will not work as expected
I'll take this up. Running some initial changes on my local to make sure I have the right idea:
wumr@88665a07f65b ~ % curl -XPUT "http://localhost:9200/my-knn-index-1" -H 'Content-Type: application/json' -d'
{
"settings": {
"index": {
"knn":true
}
},
"mappings": {
"properties": {
"my_vector1": {
"type": "knn_vector", "model_id": "1234",
"dimension": 2
}}}}'
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Failed to parse mapping [_doc]: Dimension and model can not be both specified in the mapping"}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping [_doc]: Dimension and model can not be both specified in the mapping","caused_by":{"type":"illegal_argument_exception","reason":"Dimension and model can not be both specified in the mapping"}},"status":400}%
There's also a version check in close proximity to the validation that we can look into reusing
What is the bug?
I can create knn index with knn field type contains both model id and dimension.
How can one reproduce the bug?
Steps to reproduce the behavior:
What is the expected behavior?
Should raise an exception that either model id or dimension should be provided. When model id is provided, k-NN refer dimension from training index instead of user defined dimension in mapping request body.
What is your host/environment?
N/A
Do you have any screenshots?
N/A
Do you have any additional context?
N/A
The text was updated successfully, but these errors were encountered: