public static InnerHitBuilder fromXContent(XContentParser parser) throws IOException { return PARSER.parse(parser, new InnerHitBuilder(), null); }
@Override public SearchResponse getAllMetaAlertsForAlert(String guid) throws InvalidSearchException, IOException { if (guid == null || guid.trim().isEmpty()) { throw new InvalidSearchException("Guid cannot be empty"); } // Searches for all alerts containing the meta alert guid in it's "metalerts" array QueryBuilder qb = boolQuery() .must( nestedQuery( MetaAlertConstants.ALERT_FIELD, boolQuery() .must(termQuery(MetaAlertConstants.ALERT_FIELD + "." + GUID, guid)), ScoreMode.None ).innerHit(new InnerHitBuilder()) ) .must(termQuery(MetaAlertConstants.STATUS_FIELD, MetaAlertStatus.ACTIVE.getStatusString())); return queryAllResults(elasticsearchDao.getClient().getHighLevelClient(), qb, config.getMetaAlertIndex(), pageSize); } }
/** * Given an alert GUID, retrieve all associated meta alerts. * @param alertGuid The GUID of the child alert * @return The Elasticsearch response containing the meta alerts */ protected SearchResponse getMetaAlertsForAlert(String alertGuid) throws IOException { QueryBuilder qb = boolQuery() .must( nestedQuery( MetaAlertConstants.ALERT_FIELD, boolQuery() .must(termQuery(MetaAlertConstants.ALERT_FIELD + "." + Constants.GUID, alertGuid)), ScoreMode.None ).innerHit(new InnerHitBuilder()) ) .must(termQuery(MetaAlertConstants.STATUS_FIELD, MetaAlertStatus.ACTIVE.getStatusString())); return ElasticsearchUtils .queryAllResults(elasticsearchDao.getClient().getHighLevelClient(), qb, getConfig().getMetaAlertIndex(), pageSize); }
public static InnerHitBuilder fromXContent(XContentParser parser) throws IOException { return PARSER.parse(parser, new InnerHitBuilder(), null); }
public static InnerHitBuilder fromXContent(XContentParser parser) throws IOException { return PARSER.parse(parser, new InnerHitBuilder(), null); }
public static InnerHitBuilder fromXContent(QueryParseContext context) throws IOException { return PARSER.parse(context.parser(), new InnerHitBuilder(), context); } }
InnerHitBuilder ihb = new InnerHitBuilder(); ihb.setSize(maxURLsPerBucket); ihb.setName("urls_per_bucket");