Class MultiFieldsOffsetStrategy
- java.lang.Object
-
- org.apache.lucene.search.uhighlight.FieldOffsetStrategy
-
- org.apache.lucene.search.uhighlight.MultiFieldsOffsetStrategy
-
public class MultiFieldsOffsetStrategy extends FieldOffsetStrategy
FieldOffsetStrategy that combines offsets from multiple fields. Used to highlight a single field based on matches from multiple fields.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<FieldOffsetStrategy>
fieldsOffsetStrategies
-
Fields inherited from class org.apache.lucene.search.uhighlight.FieldOffsetStrategy
components
-
-
Constructor Summary
Constructors Constructor Description MultiFieldsOffsetStrategy(java.util.List<FieldOffsetStrategy> fieldsOffsetStrategies)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getField()
OffsetsEnum
getOffsetsEnum(LeafReader reader, int docId, java.lang.String content)
The primary method -- return offsets for highlightable words in the specified document.UnifiedHighlighter.OffsetSource
getOffsetSource()
-
Methods inherited from class org.apache.lucene.search.uhighlight.FieldOffsetStrategy
createOffsetsEnumFromReader, createOffsetsEnumsForAutomata, createOffsetsEnumsForTerms, createOffsetsEnumsWeightMatcher
-
-
-
-
Field Detail
-
fieldsOffsetStrategies
private final java.util.List<FieldOffsetStrategy> fieldsOffsetStrategies
-
-
Constructor Detail
-
MultiFieldsOffsetStrategy
public MultiFieldsOffsetStrategy(java.util.List<FieldOffsetStrategy> fieldsOffsetStrategies)
-
-
Method Detail
-
getField
public java.lang.String getField()
- Overrides:
getField
in classFieldOffsetStrategy
-
getOffsetSource
public UnifiedHighlighter.OffsetSource getOffsetSource()
- Specified by:
getOffsetSource
in classFieldOffsetStrategy
-
getOffsetsEnum
public OffsetsEnum getOffsetsEnum(LeafReader reader, int docId, java.lang.String content) throws java.io.IOException
Description copied from class:FieldOffsetStrategy
The primary method -- return offsets for highlightable words in the specified document.Callers are expected to close the returned OffsetsEnum when it has been finished with
- Specified by:
getOffsetsEnum
in classFieldOffsetStrategy
- Throws:
java.io.IOException
-
-