Search in sources :

Example 26 with HighlightBuilder

use of org.graylog.shaded.elasticsearch7.org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder in project graylog2-server by Graylog2.

the class SearchRequestFactory method applyHighlighting.

private void applyHighlighting(SearchSourceBuilder searchSourceBuilder) {
    if (allowHighlighting) {
        final HighlightBuilder highlightBuilder = new HighlightBuilder().requireFieldMatch(false).field("*").fragmentSize(0).numOfFragments(0);
        searchSourceBuilder.highlighter(highlightBuilder);
    }
}
Also used : HighlightBuilder(org.graylog.shaded.elasticsearch7.org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder)

Aggregations

HighlightBuilder (org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder)21 SearchResponse (org.elasticsearch.action.search.SearchResponse)15 SearchHits (org.elasticsearch.search.SearchHits)6 ArrayList (java.util.ArrayList)5 Script (org.elasticsearch.script.Script)5 HighlightField (org.elasticsearch.search.fetch.subphase.highlight.HighlightField)5 ElasticsearchAssertions.assertSearchResponse (org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse)5 InnerHitBuilder (org.elasticsearch.index.query.InnerHitBuilder)4 SearchHit (org.elasticsearch.search.SearchHit)4 HashMap (java.util.HashMap)3 Map (java.util.Map)3 BoolQueryBuilder (org.elasticsearch.index.query.BoolQueryBuilder)3 SearchHitField (org.elasticsearch.search.SearchHitField)3 TopHits (org.elasticsearch.search.aggregations.metrics.tophits.TopHits)3 HighlightBuilder (org.graylog.shaded.elasticsearch6.org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder)3 IOException (java.io.IOException)2 Date (java.util.Date)2 ServiceResponse (net.yacy.grid.http.ServiceResponse)2 ElasticsearchClient (net.yacy.grid.io.index.ElasticsearchClient)2 Sort (net.yacy.grid.io.index.Sort)2