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

Package org.apache.lucene.search.matchhighlight

# Interface MatchRegionRetriever.MatchOffsetsConsumer

Enclosing class:
  `MatchRegionRetriever`

Functional Interface:
  This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface MatchRegionRetriever.MatchOffsetsConsumer
A callback invoked for each document selected by the query. The callback receives a list of hit ranges, document field value accessor, the leaf reader and document ID of the document.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `accept(int docId, LeafReader leafReader, int leafDocId, MatchRegionRetriever.FieldValueProvider fieldValueProvider, Map<String,List<OffsetRange>> hits)`

- ## Method Details

  - ### accept

    void accept(int docId, LeafReader leafReader, int leafDocId, MatchRegionRetriever.FieldValueProvider fieldValueProvider, Map<String,List<OffsetRange>> hits) throws IOException
    Parameters:
      `docId` - Document id (global).
      `leafReader` - Document's `LeafReader`.
      `leafDocId` - Document id (within the `LeafReader`).
      `fieldValueProvider` - Access to preloaded document fields. See the `MatchRegionRetriever(IndexSearcher, Query, OffsetsRetrievalStrategySupplier, Predicate, Predicate)` constructor's documentation for guidelines on which fields are available through this interface.
      `hits` - A map of field names and offset ranges with query hits.
    Throws:
      `IOException`