Ivan, thanks a lot for the reply, I switched to FilteredQuery (using
matchAll when no query is submitted) and that simplified my code a lot. It
also makes more sense than using post filters and filtered aggregations...
best, emanuel
Dne úterý, 9. září 2014 18:46:25 UTC+2 Ivan Brusic napsal(a):
Thanks Ivan.
Yes, it was the post filter which was ignored. We use filtered query only
when the user sends a query string, otherwise (when only exact filters for
specific columns are specified) we use the post filter. It seems strange to
me to use the FilteredQuery when the query string is
A filtered query with no explicit query will ultimately be translated into
a match-all/constant-score query at the Lucene level. I prefer to
explicitly define all my match all queries and use the specific post filter
name, and not the old filter name, which was deprecated due to its
ambiguity.
Hi there,
I just used the elasticsearch aggregations through the Java API for the
first time.
All I wanted was a simple min/max/sum/avg, so I used the Stats aggregation.
However, I was very surprised that the filter in the SearchRequestBuilder
is ignored, so I had to wrap the Stats Aggregation
The aggregation takes into account a query - but not a post-filter. I'm not
sure of the rationale behind the difference.
The java api for traversing results is quite painful - but I think a good
part of that is due to Java the fact that there is very little
polymorphic behaviour between
Which filter was ignored? I am assuming you meant the post filter (which
might be still called filter at the Java API), which in this case the
filter is bypassed by design. Post filters allow you to filter the
documents returned, but leave the aggregations as is. Sounds like you are
looking for