Hi,
When using a normal knn query this works:
"knn": [
{
"inner_hits": {
"_source": false,
"fields": [
"passages.text"
]
},
"field": "passages.vector.predicted_value",
"k": 5,
"num_candidates": 100,
"query_vector_builder": {
"text_embedding": {
"model_id": "elastic__multilingual-e5-small-optimized",
"model_text": "test text"
}
}
},
{
"field": "title.predicted_value",
"k": 5,
"num_candidates": 100,
"query_vector_builder": {
"text_embedding": {
"model_id": "elastic__multilingual-e5-small-optimized",
"model_text": "test text"
}
}
}]
Not only does an array not work, when just using 1 of the above knn queries:
{
"size": 3,
"query": {
"pinned": {
"ids": [ "1", "2" ],
"organic": {
"knn": {
"inner_hits": {
"_source": false,
"fields": [
"passages.text"
]
},
"field": "passages.vector.predicted_value",
"k": 5,
"num_candidates": 100,
"query_vector_builder": {
"text_embedding": {
"model_id": "elastic__multilingual-e5-small-optimized",
"model_text": "test query"
}
}
}
}
}
}
}
Returns the following error:
"caused_by": {
"type": "x_content_parse_exception",
"reason": "[7:15] [pinned] failed to parse field [organic]",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "[knn] queries cannot be provided directly, use the [knn] body parameter instead"
}
}
So currently I have the following issues;
- I am not able to do multiple knn queries ( Do knn queries on multiple fields.)
- I am not able to use knn queries with text, it seems I need to embed the text first.
Ps. I could not test with embeddings yet as I have problem with my inference pipeline.
Kind regards,
Chenko