I am trying to create a aggregate results in elastic search but filter option is not working for me. I can aggregate data without filter e.g. but I am facing problems to write equivalent DSL query of : Answer Should be something like this: Use a filter if you know the exact value and do not need a match, else