Class UnifiedHighlighter
- java.lang.Object
-
- org.elasticsearch.search.fetch.subphase.highlight.UnifiedHighlighter
-
- All Implemented Interfaces:
Highlighter
public class UnifiedHighlighter extends java.lang.Object implements Highlighter
-
-
Constructor Summary
Constructors Constructor Description UnifiedHighlighter()
-
Method Summary
Modifier and Type Method Description boolean
canHighlight(MappedFieldType fieldType)
protected static java.lang.String
convertFieldValue(MappedFieldType type, java.lang.Object value)
protected static java.util.List<Snippet>
filterSnippets(java.util.List<Snippet> snippets, int numberOfFragments)
protected org.apache.lucene.analysis.Analyzer
getAnalyzer(DocumentMapper docMapper, MappedFieldType type, FetchSubPhase.HitContext hitContext)
protected java.text.BreakIterator
getBreakIterator(SearchContextHighlight.Field field)
protected org.apache.lucene.search.uhighlight.UnifiedHighlighter.OffsetSource
getOffsetSource(MappedFieldType fieldType)
protected org.apache.lucene.search.uhighlight.PassageFormatter
getPassageFormatter(FetchSubPhase.HitContext hitContext, SearchContextHighlight.Field field, org.apache.lucene.search.highlight.Encoder encoder)
HighlightField
highlight(HighlighterContext highlighterContext)
protected java.util.List<java.lang.Object>
loadFieldValues(MappedFieldType fieldType, SearchContextHighlight.Field field, SearchContext context, FetchSubPhase.HitContext hitContext)
protected static java.lang.String
mergeFieldValues(java.util.List<java.lang.Object> fieldValues, char valuesSeparator)
-
-
-
Method Detail
-
canHighlight
public boolean canHighlight(MappedFieldType fieldType)
- Specified by:
canHighlight
in interfaceHighlighter
-
highlight
public HighlightField highlight(HighlighterContext highlighterContext)
- Specified by:
highlight
in interfaceHighlighter
-
getPassageFormatter
protected org.apache.lucene.search.uhighlight.PassageFormatter getPassageFormatter(FetchSubPhase.HitContext hitContext, SearchContextHighlight.Field field, org.apache.lucene.search.highlight.Encoder encoder)
-
getAnalyzer
protected org.apache.lucene.analysis.Analyzer getAnalyzer(DocumentMapper docMapper, MappedFieldType type, FetchSubPhase.HitContext hitContext)
-
loadFieldValues
protected java.util.List<java.lang.Object> loadFieldValues(MappedFieldType fieldType, SearchContextHighlight.Field field, SearchContext context, FetchSubPhase.HitContext hitContext) throws java.io.IOException
- Throws:
java.io.IOException
-
getBreakIterator
protected java.text.BreakIterator getBreakIterator(SearchContextHighlight.Field field)
-
filterSnippets
protected static java.util.List<Snippet> filterSnippets(java.util.List<Snippet> snippets, int numberOfFragments)
-
convertFieldValue
protected static java.lang.String convertFieldValue(MappedFieldType type, java.lang.Object value)
-
mergeFieldValues
protected static java.lang.String mergeFieldValues(java.util.List<java.lang.Object> fieldValues, char valuesSeparator)
-
getOffsetSource
protected org.apache.lucene.search.uhighlight.UnifiedHighlighter.OffsetSource getOffsetSource(MappedFieldType fieldType)
-
-