I have two indices, one with users and one with user posts. I want to search both indices simultaneously, and rank them. As part of this search, i want to do a kNN search as well as a standard text search. However, the kNN search is only applied to the posts, not to the users. Is this possible? I have tried the following:
{
"_source": ["_id", "video_url"],
"track_total_hits": true,
"query": {
"exists":{
"field": "avg_vector"
}
},
"knn": {
"field": "frame_vectors.frame_vector",
"query_vector": [
0.0159149169921875,
-0.031982421875,
0.058349609375,
....
],
"num_candidates": 100,
"filter": [
{
"exists": {
"field": "avg_vector"
}
},
{
"exists": {
"field": "frame_vectors"
}
}
]
}
}
but unfortunately getting a list of posts (which match the kNN) and then the user index is erroring:
"_shards": {
"total": 16,
"successful": 15,
"skipped": 0,
"failed": 1,
"failures": [
{
"shard": 0,
"index": "user",
"node": "RUSE4yhWTgufSSfBLUnVoA",
"reason": {
"type": "query_shard_exception",
"reason": "failed to create query: [nested] failed to find nested object under path [frame_vectors]",
"index_uuid": "VCQz4HZaRsCBeeQlLFPATw",
"index": "user",
"caused_by": {
"type": "illegal_state_exception",
"reason": "[nested] failed to find nested object under path [frame_vectors]"
}
}
}
]
},