I have two search terms "86746184549" and "3302093809". I am executing two separate term queries to fetch one document matching each of the ids.
"size":1,
"query":{
"term":{
"from_user_id": "86746184549"
}
}
and
"size":1,
"query":{
"term":{
"from_user_id": "3302093809"
}
}
Is there are a way to combine these 2 queries, something similar to what we do in facets.
{
"facets":{
"facet_1":{
},
"facet_2":{
},
"facet_3":{
}
}
}
I don't think the terms query will work here because, that wont return documents containing distinct from_user_id
field.
The reason I want to combine the queries is because, say if I have 100 such terms then I will be making 100 calls!! to the elasticsearch server.