I am currently trying to build a search where the knn search will be used within the set of results from a terms query. Below is my test query, but I run into an error "malformed query, expected [END_OBJECT] but found [FEILD_NAME]"
GET my-index2/_search
{
"query":{
"bool":{
"should":[
{"terms":{"t":["hello"]}}
]
},
"knn": {
"my_vector2": {
"vector": [2, 3, 5, 6],
"k": 2
}
}
},
"_source":["t"]
}
Is there anyway to accomplish this?