Hi ,
I am using Elastic search 5.1 and I have built two indexes say brand and products index . I do a search on the brand index using these fields
1.Brand
2.Brand extension
3. Local brand .
I take top 10 results from the brand query and used as the filter for the products index search
For each brand result I am sending a query to products index Hence I am doing 10 searches on the products index and getting top 10 for every request . which returns 100 documents in total
How to combine all the 10 search query into a single search query ?
Say I have these two results from brand query as
Result 1
- BRAND =PEPSI
- LOCALBRAND =PEPSI
- BRANDEXT=DIET PEPSI
Result 2 - BRAND =PEPSI123
- LOCALBRAND =PEPSI COMPANY
- BRANDEXT=DIET PEPSI234
How do I modify this below filter query ? i.e for the same match clause I have to apply result 1 combination and result2 combination as the filters
{
"query": {
"bool": {
"should": {
"match": {
"ITEMDESCRIPTION": "COCA COLA 1 liter BOTEL"
}
},
"filter": [
{
"term": {
"BRANDEXT": "DIET COKE "
}
},
{
"term": {
"LOCALBRAND": "COKE"
}
},
{
"term": {
"BRAND": "COCA COLA"
}
}
]
}
}
}