salvador
salvador

Reputation: 1089

Apply filters after search with elastic search

I have the following use case scenario. I am doing a search with some query terms by aggregating some fields without applying any filters initially. Now let's say the results are 100,000 and I have 50,000 from class A and 50,000 from class B. In the UI if I click the class A button, I want to filter the results and show one the ones that belong to class A. Is this possible without doing a new search. Can I filter the results after the search is done. If yes how I can do it? Some java code would be much appreciated.

Upvotes: 0

Views: 180

Answers (1)

eliasah
eliasah

Reputation: 40380

You should use post_filters. You can get check the official page here for more information about that.

You can also read about filters work in the blog post here.

This is mainly how filters work :

enter image description here

Upvotes: 1

Related Questions