Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

"NaN" vector fields are accepted. Docs with NaN fields should be rejected #99

Closed
vamshin opened this issue Apr 26, 2020 · 0 comments
Closed

Comments

@vamshin
Copy link
Member

vamshin commented Apr 26, 2020

NaN fields are accepted during indexing time but search is broken because of the bad data resulting in process crash.

Reproduce Issue

curl -X PUT "localhost:9200/myindex" -H 'Content-Type: application/json' -d'
{
"settings" : {
"number_of_shards" : 1,
"number_of_replicas" : 0,
"index": {
"knn": true
}
},
"mappings": {
"properties": {
"my_vector": {
"type": "knn_vector",
"dimension": 2
}
}
}
}
'

curl -X POST "localhost:9200/myindex/_doc/1?refresh=true" -H 'Content-Type: application/json' -d'
{
"my_vector" : ["NaN", "NaN"],
"price":10
}
'

Output

{"_index":"myindex","_type":"_doc","_id":"1","_version":2,"result":"updated","forced_refresh":true,"_shards":{"total":1,"successful":1,"failed":0},"_seq_no":1,"_primary_term":1}

Code changes here https://github.com/opendistro-for-elasticsearch/k-NN/blob/master/src/main/java/com/amazon/opendistroforelasticsearch/knn/index/KNNVectorFieldMapper.java#L246

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants