Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
2.15 / 2.18
Describe the issue:
I have a Hybrid query which is having a multi_match and a neural query. The results individually match these queries. I need results which definitely matches the query string mentioned in the multi_match query. In my example I want to search for Open Tickets about some issue. The issue is mentioned in the neural query against which I want to do a semantic search. For the multi_match , I wangt to perform the query with string as Open. The results should ensure that whicever Service Requests match the semantic meaning ALSO have status(or some other field..hence multi_match) as Open. I do not want CLosed Service Requests in my results even though some of these might have very high relevance score from the neural search.
I have tried to nest it bool query with ‘must’. But the results do not change.
Configuration:
original request where I want Open Service Requests with clinical information
{
“_source”: {
“exclude”: [
“embeddingVector”
]
},
“query”: {
“hybrid”: {
“queries”: [
{
“multi_match”: {
“query”: “Open”
}
},
{
“neural”: {
“embeddingVector”: {
“query_text”: “clinical”,
“model_id”: “AVixxxj”,
“k”: 3
}
}
}
]
}
}
}
Request payload where Bool query is wrapped around hybrid search:
{
“_source”: {
“exclude”: [
“embeddingVector”
]
},
“query”: {
“bool” : {
“must”: [ {
“hybrid”: {
“queries”: [
{
“multi_match”: {
“query”: “Open”
}
},
{
“neural”: {
“embeddingVector”: {
“query_text”: “clinical”,
“model_id”: “AVxxxxxj”,
“k”: 3
}
}
}
]
}
}]
}
}
}
Relevant Logs or Screenshots: