1

I keep getting an Unsupported Aggregation error for anything but "terms".

I'm building aggregations like:

AggregationBuilders.filter(name).filter(FilterBuilders.wrapperFilter("[WRAPPED FILTER SOURCE]"));

And adding it to the search with SearchRequestBuilder's addAggregation

When I use a terms aggregation, it works fine and returns buckets as expected. But a filter or range gives org.elasticsearch.search.aggregations.bucket.filter.InternalFilter as an unsupported.

The strange thing is running the query (the one that the Java API gives on a to string) through the REST endpoint works fine.

1
  • Is your client Java application using the correct version of Elasticsearch? Commented Aug 15, 2014 at 20:28

1 Answer 1

0

I'ts probably because you are not setting the field via the .field("fieldName") method as in AggregationBuilders.sum("my_sum").field("fieldToSum"). I believe you won't even need the wrapperFilter doing it this way.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.