Filters in query

I have an index of webpages where each doc has a 'domain' field.
I want to run a query on the content, but want to filter documents based on domains i.e. all results from one domain and second use case being excluding results from certain domains.
My queries run fine in Java, but i am using setPostFilter(...) method which does the filtering step after the query is executed. I am interested in making both the queries faster. How do i achieve that?

What ive been trying so far -

  • bool query with should/must on content, must_not on domain :: for excluding results only with certain domain
  • bool query with should/must on content, postFilter on domain :: for including results only with certain domain
    using ES v2.4.0

Thanks in advance

bool query with should/must on content, must_not on domain :: for excluding results only with certain domain

It's the best option IMO.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.