I have bool query which is perfectly satisfying my request which is like:
GET product/product/_search?pretty
{
"query" : {
"bool": {
"should": [
{
"term": {
"field1" : "xxxx1"
}
},
{
"term" : {
"field2" : "xxxx2"
}
},
{
"term" : {
"field1" : "xxxx3"
}
}
]
}
}
}
I am thinking whether this will be faster or multisearch request like shown below.
But in multisearch request I need coagulate all responses if there responses with same document in it.
But in above, for e.g. I am getting 2 documents. This is what I require.
In case of multisearch, I will get 3 documents for each queries out of which two will be same, so I need to coagulate it using set on the key value from document.
My multi search request will be like:
curl -H "Content-Type: application/x-ndjson" -XGET localhost:9200/_msearch --data-binary "@request"
where request is
{"index":"product"}
{"query" : {"term" : {"field1" : "xxxx1"}}}
{"index":"product"}
{"query" : {"term" : {"field2" : "xxxx2"}}}
{"index":"product"}
{"query" : {"term" : {"field1" : "xxxx3"}}}