diff --git a/core/src/main/java/org/elasticsearch/search/fetch/subphase/highlight/PostingsHighlighter.java b/core/src/main/java/org/elasticsearch/search/fetch/subphase/highlight/PostingsHighlighter.java index 330fb908cc5e8..3d5eedc9b99df 100644 --- a/core/src/main/java/org/elasticsearch/search/fetch/subphase/highlight/PostingsHighlighter.java +++ b/core/src/main/java/org/elasticsearch/search/fetch/subphase/highlight/PostingsHighlighter.java @@ -28,6 +28,8 @@ import org.apache.lucene.search.highlight.Snippet; import org.apache.lucene.util.CollectionUtil; import org.elasticsearch.common.Strings; +import org.elasticsearch.common.logging.DeprecationLogger; +import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.text.Text; import org.elasticsearch.index.mapper.FieldMapper; import org.elasticsearch.search.fetch.FetchPhaseExecutionException; @@ -44,13 +46,15 @@ import java.util.Locale; import java.util.Map; +@Deprecated public class PostingsHighlighter implements Highlighter { + private static DeprecationLogger deprecationLogger = new DeprecationLogger(Loggers.getLogger(PostingsHighlighter.class)); private static final String CACHE_KEY = "highlight-postings"; @Override public HighlightField highlight(HighlighterContext highlighterContext) { - + deprecationLogger.deprecated("[postings] highlighter is deprecated, please use [unified] instead"); FieldMapper fieldMapper = highlighterContext.mapper; SearchContextHighlight.Field field = highlighterContext.field; if (canHighlight(fieldMapper) == false) { diff --git a/docs/reference/search/request/highlighting.asciidoc b/docs/reference/search/request/highlighting.asciidoc index 5ba94f7296153..7bfcd5621e2b6 100644 --- a/docs/reference/search/request/highlighting.asciidoc +++ b/docs/reference/search/request/highlighting.asciidoc @@ -60,8 +60,13 @@ This is repeated for every field and every document that needs highlighting. If [[postings-highlighter]] ==== Postings highlighter +deprecated[5.5.0,This highlighter type is deprecated and will be removed. Please use the `unified` highlighter instead. ] + + If `index_options` is set to `offsets` in the mapping the postings highlighter -will be used instead of the plain highlighter. The postings highlighter: +will be used instead of the plain highlighter. + +The postings highlighter: * Is faster since it doesn't require to reanalyze the text to be highlighted: the larger the documents the better the performance gain should be