private static TopHitsAggregationBuilder createSubAggregation(SuggestionQuery query) { return AggregationBuilders.topHits(DOCS_AGGREGATION_NAME) .highlighter(new HighlightBuilder() .encoder("html") .preTags("<mark>") .postTags("</mark>") .field(createHighlighterField())) .from(query.getSkip()) .size(query.getLimit()) .sort(new ScoreSortBuilder()) .sort(new FieldSortBuilder(ComponentIndexDefinition.FIELD_NAME)) .fetchSource(false); }
/** * Read from a stream. */ public HighlightBuilder(StreamInput in) throws IOException { super(in); encoder(in.readOptionalString()); useExplicitFieldOrder(in.readBoolean()); this.fields = in.readList(Field::new); assert this.equals(new HighlightBuilder(this, highlightQuery, fields)) : "copy constructor is broken"; }
/** * Read from a stream. */ public HighlightBuilder(StreamInput in) throws IOException { super(in); encoder(in.readOptionalString()); useExplicitFieldOrder(in.readBoolean()); this.fields = in.readList(Field::new); assert this.equals(new HighlightBuilder(this, highlightQuery, fields)) : "copy constructor is broken"; }
/** * Read from a stream. */ public HighlightBuilder(StreamInput in) throws IOException { super(in); encoder(in.readOptionalString()); useExplicitFieldOrder(in.readBoolean()); int fields = in.readVInt(); for (int i = 0; i < fields; i++) { field(new Field(in)); } }
/** * Read from a stream. */ public HighlightBuilder(StreamInput in) throws IOException { super(in); encoder(in.readOptionalString()); useExplicitFieldOrder(in.readBoolean()); this.fields = in.readList(Field::new); assert this.equals(new HighlightBuilder(this, highlightQuery, fields)) : "copy constructor is broken"; }
private static TopHitsAggregationBuilder createSubAggregation(SuggestionQuery query) { return AggregationBuilders.topHits(DOCS_AGGREGATION_NAME) .highlighter(new HighlightBuilder() .encoder("html") .preTags("<mark>") .postTags("</mark>") .field(createHighlighterField())) .from(query.getSkip()) .size(query.getLimit()) .sort(new ScoreSortBuilder()) .sort(new FieldSortBuilder(ComponentIndexDefinition.FIELD_NAME)) .fetchSource(false); }