OffsetsFromMatchIterator (Lucene 10.5.0 highlighter API)
Description: declaration: package: org.apache.lucene.search.matchhighlight, class: OffsetsFromMatchIterator

Package org.apache.lucene.search.matchhighlight

# Class OffsetsFromMatchIterator

java.lang.Object
org.apache.lucene.search.matchhighlight.OffsetsFromMatchIterator

All Implemented Interfaces:
  `OffsetsRetrievalStrategy`

public final class OffsetsFromMatchIterator extends Object implements OffsetsRetrievalStrategy
This strategy retrieves offsets directly from `MatchesIterator`, if they are available, otherwise it falls back to using `OffsetsFromPositions`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `OffsetsFromMatchIterator(String field, OffsetsFromPositions noOffsetsFallback)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `List<OffsetRange>`
  `get(MatchesIterator matchesIterator, MatchRegionRetriever.FieldValueProvider doc)`
  Return value offsets (match ranges) acquired from the given `MatchesIterator`.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### OffsetsFromMatchIterator

    public OffsetsFromMatchIterator(String field, OffsetsFromPositions noOffsetsFallback)

- ## 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 given `MatchesIterator`.
    Specified by:
      `get` in interface `OffsetsRetrievalStrategy`
    Throws:
      `IOException`