IndexSearcher.LeafReaderContextPartition (Lucene 10.5.0 core API)
Description: declaration: package: org.apache.lucene.search, class: IndexSearcher, class: LeafReaderContextPartition

Package org.apache.lucene.search

# Class IndexSearcher.LeafReaderContextPartition

java.lang.Object
org.apache.lucene.search.IndexSearcher.LeafReaderContextPartition

Enclosing class:
  `IndexSearcher`

public static final class IndexSearcher.LeafReaderContextPartition extends Object
Holds information about a specific leaf context and the corresponding range of doc ids to search within. Used to optionally search across partitions of the same segment concurrently.

A partition instance can be created via `createForEntireSegment(LeafReaderContext)`, in which case it will target the entire provided `LeafReaderContext`. A true partition of a segment can be created via `createFromAndTo(LeafReaderContext, int, int)` providing the minimum doc id (including) to search as well as the max doc id (excluding).

WARNING: This API is experimental and might change in incompatible ways in the next release.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `final LeafReaderContext`
  `ctx`
  `final int`
  `maxDocId`
  `final int`
  `minDocId`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static IndexSearcher.LeafReaderContextPartition`
  `createForEntireSegment(LeafReaderContext ctx)`
  Creates a partition of the provided leaf context that targets the entire segment
  `static IndexSearcher.LeafReaderContextPartition`
  `createFromAndTo(LeafReaderContext ctx, int minDocId, int maxDocId)`
  Creates a partition of the provided leaf context that targets a subset of the entire segment, starting from and including the min doc id provided, until and not including the provided max doc id

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

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

- ## Field Details

  - ### minDocId

    public final int minDocId

  - ### maxDocId

    public final int maxDocId

  - ### ctx

    public final LeafReaderContext ctx

- ## Method Details

  - ### createForEntireSegment

    public static IndexSearcher.LeafReaderContextPartition createForEntireSegment(LeafReaderContext ctx)
    Creates a partition of the provided leaf context that targets the entire segment

  - ### createFromAndTo

    public static IndexSearcher.LeafReaderContextPartition createFromAndTo(LeafReaderContext ctx, int minDocId, int maxDocId)
    Creates a partition of the provided leaf context that targets a subset of the entire segment, starting from and including the min doc id provided, until and not including the provided max doc id