Hi @utpal
0.5 would be the score given by L2. I am not sure what is causing this error.
Checking out the code and tag v.1.9.0.0
, and running locally with ./gradlew run
, I was unable to reproduce the issue with the following commands:
export HOST_NAME=localhost:9200
curl -X PUT "${HOST_NAME}/myindex" -H 'Content-Type: application/json' -d'
{
"settings" : {
"number_of_shards" : 1,
"number_of_replicas" : 0,
"index": {
"knn": true,
"knn.space_type": "cosinesimil"
}
},
"mappings": {
"properties": {
"my_vector": {
"type": "knn_vector",
"dimension": 2
}
}
}
}
'
{"acknowledged":true,"shards_acknowledged":true,"index":"myindex"}
curl -X POST "${HOST_NAME}/myindex/_doc" -H 'Content-Type: application/json' -d'
> {
> "my_vector" : [2, 1],
> "status":1
> }
> '
{"_index":"myindex","_type":"_doc","_id":"nEgo_3QBbqF0R1iJ2SSG","_version":1,"result":"created","_shards":{"total":1,"successful":1,"failed":0},"_seq_no":0,"_primary_term":1}
curl -X PUT "${HOST_NAME}/myindex/_doc/2" -H 'Content-Type: application/json' -d'
> {
> "my_vector" : [2, 2],
> "status":1
> }
> '
{"_index":"myindex","_type":"_doc","_id":"2","_version":1,"result":"created","_shards":{"total":1,"successful":1,"failed":0},"_seq_no":1,"_primary_term":1}
curl -X PUT "${HOST_NAME}/myindex/_doc/4?refresh=true" -H 'Content-Type: application/json' -d'
> {
> "my_vector" : [2, 3],
> "status":1
> }
> '
{"_index":"myindex","_type":"_doc","_id":"4","_version":1,"result":"created","forced_refresh":true,"_shards":{"total":1,"successful":1,"failed":0},"_seq_no":2,"_primary_term":1}
curl -X POST "${HOST_NAME}/myindex/_search" -H 'Content-Type: application/json' -d'
> {
> "size": 1,
> "query": {
> "knn": {
> "my_vector": { // attribute embedding is of type knn_vector
> "vector": [1, 1],
> "k": 1
> }
> }
> },
> "post_filter": {
> "term": {"status": 1}
> }
> }
> '
{"took":101,"timed_out":false,"_shards":{"total":1,"successful":1,"skipped":0,"failed":0},"hits":{"total":{"value":2,"relation":"eq"},"max_score":1.0,"hits":[{"_index":"myindex","_type":"_doc","_id":"2","_score":1.0,"_source":
{
"my_vector" : [2, 2],
"status":1
}
...
{"took":8,"timed_out":false,"_shards":{"total":1,"successful":1,"skipped":0,"failed":0},"hits":{"total":{"value":2,"relation":"eq"},"max_score":1.0,"hits":[{"_index":"myindex","_type":"_doc","_id":"2","_score":1.0,"_source":
{
"my_vector" : [2, 2],
"status":1
}
...
{"took":8,"timed_out":false,"_shards":{"total":1,"successful":1,"skipped":0,"failed":0},"hits":{"total":{"value":2,"relation":"eq"},"max_score":1.0,"hits":[{"_index":"myindex","_type":"_doc","_id":"2","_score":1.0,"_source":
{
"my_vector" : [2, 2],
"status":1
}
...
{"took":2,"timed_out":false,"_shards":{"total":1,"successful":1,"skipped":0,"failed":0},"hits":{"total":{"value":2,"relation":"eq"},"max_score":1.0,"hits":[{"_index":"myindex","_type":"_doc","_id":"2","_score":1.0,"_source":
{
"my_vector" : [2, 2],
"status":1
}
Could you provide the following information?
- Index mapping
- Index settings
- ODFE artifact type (rpm, deb, docker, etc.)
- Number of nodes in the cluster
Additionally, does it fail with the same error for ODFE v1.10.1.0?
Jack