org.elasticsearch.search.aggregations.bucket.missing.Missing Java Examples

The following examples show how to use org.elasticsearch.search.aggregations.bucket.missing.Missing. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AggregateResponseParser.java    From molgenis with GNU Lesser General Public License v3.0 5 votes vote down vote up
private Missing getMissingAggregation(Aggregations aggs, Attribute attr) {
  Aggregation agg = aggs.get(attr.getName() + FieldConstants.AGGREGATION_MISSING_POSTFIX);
  if (agg == null) {
    throw new RuntimeException("Missing missing aggregation");
  }
  if (!(agg instanceof Missing)) {
    throw new RuntimeException("Aggregation is not a missing aggregation");
  }
  return (Missing) agg;
}