This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
KNNVectorFieldMapper unable to get algorithm params from settings when built from merge #288
Labels
bug
Issue that exposes a bug
When the KNNVectorFieldMapper is built from a mapper merge, the mapper is unable to read the algorithm parameters that are stored as index settings. Because of this, it falls back to default settings. Because spaceType is one of the parameters, this can lead to incorrect graphs being built for an index. For example, a user may create a
cosinesimil
index and the graphs will be built using thel2
case.Relevant lines of code:
1 https://github.com/opendistro-for-elasticsearch/k-NN/blob/master/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/KNNVectorFieldMapper.java#L124-L163
2. https://github.com/opendistro-for-elasticsearch/k-NN/blob/master/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/KNNVectorFieldMapper.java#L349
3. https://github.com/elastic/elasticsearch/blob/7.10/server/src/main/java/org/elasticsearch/index/mapper/ParametrizedFieldMapper.java#L104
For basic use cases where the mapping does not change after index creation, this bug will not make any impact. However, this bug may impact indices with dynamic mappings.
Reproduction steps:
This change should resolve the problem. In the future, we should switch these algorithm parameters from index settings to mapping parameters (tracking this in #282).
Impacted ODFE Version:
Related issues:
The text was updated successfully, but these errors were encountered: