Class OffsetsFromPositions
java.lang.Object
org.apache.lucene.search.matchhighlight.OffsetsFromPositions
- All Implemented Interfaces:
OffsetsRetrievalStrategy
This strategy applies to fields with stored positions but no offsets. We re-analyze the field's
value to find out offsets of match positions.
Note that this may fail if index data (positions stored in the index) is out of sync with the field values or the analyzer. This strategy assumes it'll never happen.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) List
<OffsetRange> convertPositionsToOffsets
(ArrayList<OffsetRange> positionRanges, List<String> values) get
(MatchesIterator matchesIterator, MatchRegionRetriever.FieldValueProvider doc) Return value offsets (match ranges) acquired from the givenMatchesIterator
.
-
Field Details
-
field
-
analyzer
-
-
Constructor Details
-
OffsetsFromPositions
-
-
Method Details
-
get
public List<OffsetRange> get(MatchesIterator matchesIterator, MatchRegionRetriever.FieldValueProvider doc) throws IOException Description copied from interface:OffsetsRetrievalStrategy
Return value offsets (match ranges) acquired from the givenMatchesIterator
.- Specified by:
get
in interfaceOffsetsRetrievalStrategy
- Throws:
IOException
-
convertPositionsToOffsets
List<OffsetRange> convertPositionsToOffsets(ArrayList<OffsetRange> positionRanges, List<String> values) throws IOException - Throws:
IOException
-