Package org.apache.lucene.index

## Class LeafMetaData

- java.lang.Object
- - org.apache.lucene.index.LeafMetaData

-     public final class LeafMetaData
      extends Object

  Provides read-only metadata about a leaf.
  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `LeafMetaData​(int createdVersionMajor, Version minVersion, Sort sort, boolean hasBlocks)` | Expert: Sole constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `int` | `getCreatedVersionMajor()` | Get the Lucene version that created this index.
    `Version` | `getMinVersion()` | Return the minimum Lucene version that contributed documents to this index, or `null` if this information is not available.
    `Sort` | `getSort()` | Return the order in which documents from this index are sorted, or `null` if documents are in no particular order.
    `boolean` | `hasBlocks()` | Returns `true` iff this index contains blocks created with `IndexWriter.addDocument(Iterable)` or it's corresponding update methods with at least 2 or more documents per call.

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

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

- - ### Constructor Detail

    - #### LeafMetaData

          public LeafMetaData​(int createdVersionMajor,
                              Version minVersion,
                              Sort sort,
                              boolean hasBlocks)

      Expert: Sole constructor. Public for use by custom `LeafReader` impls.

  - ### Method Detail

    - #### getCreatedVersionMajor

          public int getCreatedVersionMajor()

      Get the Lucene version that created this index. This can be used to implement backward compatibility on top of the codec API. A return value of `6` indicates that the created version is unknown.

    - #### getMinVersion

          public Version getMinVersion()

      Return the minimum Lucene version that contributed documents to this index, or `null` if this information is not available.

    - #### getSort

          public Sort getSort()

      Return the order in which documents from this index are sorted, or `null` if documents are in no particular order.

    - #### hasBlocks

          public boolean hasBlocks()

      Returns `true` iff this index contains blocks created with `IndexWriter.addDocument(Iterable)` or it's corresponding update methods with at least 2 or more documents per call. Note: This property was not recorded before `Version.LUCENE_9_9_0` this method will return false for all leaves written before `Version.LUCENE_9_9_0`
      See Also:
        `IndexWriter.updateDocuments(Term, Iterable)`, `IndexWriter.updateDocuments(Query, Iterable)`, `IndexWriter.softUpdateDocuments(Term, Iterable, Field...)`, `IndexWriter.addDocuments(Iterable)`