Closed elb3k closed 3 years ago
Hi @Elbek-Khoshimjonov,
Looks like casting knn_vector
in painless scripting seems to be a saolution(Does not look easy though). Share us the sample queries on how you do this for community members ending up on this thread for similar operations.
I am using knn_vector type with l2 distance. Finding k candidates works great and fast. But I need to get accuracy field as well. Accuracy is defined as
1 - l1norm( normalize(vector), normalize(input) ) / 2
To calculate accuracy as
script_field
, I need to castknn_vector
todense_vector
orArrayList (in Painless scripting language)
.Is there any formal way of converting
knn_vector
todense_vector
? P.S I am calculating accuracy after knn query (with k=5), so semi-efficent or not efficent methods are fine.