I am using a search_application, mustache template to execute a KNN search. The following is the relevant section of the template:
"knn": [
{
"field": "content_embedding_external.predicted_value",
"k": {{knn_size}},
"num_candidates": {{knn_num_of_candidates}},
"boost": {{vector_content_boost}},
"similarity": "{{{knn_minimum_similarity}}}",
"query_vector": {{{query_string_embeddings}}}
]
}
The endpoint is:
/_application/search_application/template_search-arroway-v1/_render_query
Here's the thing, when I pass in (abbreviated for the purpose of this post):
{
"params": {
"query_string_embeddings": "[0,1,2]"
}
}
Everything works as expected. That is the KNN query_vector displays with the array value of: [0,1,2] as one would expect.
BUT, if I pass the parameter as it needs to be (ADA embedding), like:
"query_string_embeddings": "[-0.021204991,-0.013258362,0.011000876]",
I get the error:
{
"error": {
"root_cause": [
{
"type": "null_pointer_exception",
"reason": "Cannot invoke \"com.fasterxml.jackson.core.JsonLocation.getLineNr()\" because \"loc\" is null"
}
],
"type": "null_pointer_exception",
"reason": "Cannot invoke \"com.fasterxml.jackson.core.JsonLocation.getLineNr()\" because \"loc\" is null"
},
"status": 500
}
I would appear that underlying search template/jackson json parsing, has a bug related to floats. Then again, I might need to encode passing of the parameters differently.
Suggestions?