Hi,
Each of my documents contain a list of dense_vectors inside a nested object : words.vector
I try to compare my input vector to all documents' words.vector
properties.
I currently try with the following but elasticsearch tells me script_score function must not produce negative scores...
:
GET test_words/_search
{
"query": {
"nested": {
"path": "words",
"score_mode": "min",
"query": {
"function_score": {
"script_score": {
"script": {
"source": "cosineSimilarity(params.myvector, 'words.vector')",
"params": {
"myvector": [
-1.310115814,
-0.399771153,
-0.420954197,
1.589795112
]
}
}
}
}
}
}
}
}
How could I achieve that ?
Thank you,