Reputation: 408
I'm trying to find out whether l1norm function calculates score the way I think it is.
So I have this index
PUT my-index-000001
{
"mappings": {
"properties": {
"my_dense_vector": {
"type": "dense_vector",
"dims": 3
}
}
}
}
PUT my-index-000001/_doc/1
{
"my_dense_vector": [3, 4, 5]
}
PUT my-index-000001/_doc/2
{
"my_dense_vector": [1, 2, 3]
}
POST my-index-000001/_refresh
When I execute this query:
GET my-index-000001/_search
{
"query": {
"script_score": {
"query" : {
"match_all" : {}
},
"script": {
"source": "l1norm(params.queryVector, 'my_dense_vector')",
"params": {
"queryVector": [3, 3, 3]
}
}
}
}
}
It seems like the scores are calculated as sum of absolute deltas, or this formula
ABS(X1-Y1) + ABS(X2-Y2) + ABS(X3-Y3)
I just want confirm if this is how the scores are calculated for l1norm
function
Upvotes: 0
Views: 54