/** * Constructs a new score sort. */ public static ScoreSortBuilder scoreSort() { return new ScoreSortBuilder(); }
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); }
private static SortBuilder<?> fieldOrScoreSort(String fieldName) { if (fieldName.equals(ScoreSortBuilder.NAME)) { return new ScoreSortBuilder(); } else { return new FieldSortBuilder(fieldName); } }
/** * Constructs a new score sort. */ public static ScoreSortBuilder scoreSort() { return new ScoreSortBuilder(); }
/** * Constructs a new score sort. */ public static ScoreSortBuilder scoreSort() { return new ScoreSortBuilder(); }
/** * Constructs a new score sort. */ public static ScoreSortBuilder scoreSort() { return new ScoreSortBuilder(); }
/** * Constructs a new score sort. */ public static ScoreSortBuilder scoreSort() { return new ScoreSortBuilder(); }
private static SortBuilder<?> fieldOrScoreSort(String fieldName) { if (fieldName.equals(ScoreSortBuilder.NAME)) { return new ScoreSortBuilder(); } else { return new FieldSortBuilder(fieldName); } }
private static SortBuilder<?> fieldOrScoreSort(String fieldName) { if (fieldName.equals(ScoreSortBuilder.NAME)) { return new ScoreSortBuilder(); } else { return new FieldSortBuilder(fieldName); } }
private static SortBuilder<?> fieldOrScoreSort(String fieldName) { if (fieldName.equals(ScoreSortBuilder.NAME)) { return new ScoreSortBuilder(); } else { return new FieldSortBuilder(fieldName); } }
/** * Similar as {@link #setTrackScores(boolean)}, but whether to sort by the score descending. */ public PercolateSourceBuilder setSort(boolean sort) { if (sort) { addSort(new ScoreSortBuilder()); } else { this.sorts = null; } return this; }
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); }