I want to filter Product with 2 field, Category and Brand_id.
Category:
Product.__elasticsearch__.search query: { match: { category: "Pulls & Gilets" } }
I got a total of 116
Brand_id:
Product.__elasticsearch__.search query: { match: { brand_id: "1" } }
I got a total of 4
Both:
Product.__elasticsearch__.search query: {
bool: {
must: {
term: { brand_id: "1" }
},
must: {
term: { category: "Pulls & Gilets" }
}
}
}
I should have a total of 4 and I got 0. I've tried with "filter" instead of "must" but same result. Thanks
term: { category: "Pulls & Gilets" }.. in second query. Go withmatch