I am new in ElasticSearch. So far I could implement the search successfully and also aggregations to build my filter as shown below
{
"from": 0,
"size": 5,
"explain": false,
"aggs": {
"Condition_aggs": {
"terms": {
"field": "Condition"
}
},
"Color_aggs": {
"terms": {
"field": "color"
}
}
},
"query": {
"bool": {
"should": [
{
"multi_match": {
"type": "best_fields",
"query": "tn2000",
"fields": [
"Number^8",
"Name.raw^7.5",
"Name^7"
]
}
}
]
}
}
}
I am getting aggregations for filter but I dont know how to do next step when filter is selected on the page. for example If red color is selected. should I use a filter term query instead of multi-match query or should I extend above multi-match query with filters? Not sure how to achieve this. I appreciate if somebody can shed me some lights ? and short example will be lovely.
thanks,
Emil