Lucene90SegmentInfoFormat (Lucene 10.5.0 backward-codecs API)
Description: declaration: package: org.apache.lucene.backward_codecs.lucene90, class: Lucene90SegmentInfoFormat

Package org.apache.lucene.backward_codecs.lucene90

# Class Lucene90SegmentInfoFormat

java.lang.Object
org.apache.lucene.codecs.SegmentInfoFormat
org.apache.lucene.backward_codecs.lucene90.Lucene90SegmentInfoFormat

public class Lucene90SegmentInfoFormat extends SegmentInfoFormat
Lucene 9.0 Segment info format.

Files:

- `.si`: Header, SegVersion, SegSize, IsCompoundFile, Diagnostics, Files, Attributes, IndexSort, Footer

Data types:

- Header --> `IndexHeader`
- SegSize --> `Int32`
- SegVersion --> `String`
- SegMinVersion --> `String`
- Files --> `Set<String>`
- Diagnostics,Attributes --> `Map<String,String>`
- IsCompoundFile --> `Int8`
- IndexSort --> `Int32` count, followed by `count` SortField
- SortField --> `String` sort class, followed by a per-sort bytestream (see `SortFieldProvider.readSortField(DataInput)`)
- Footer --> `CodecFooter`

Field Descriptions:

- SegVersion is the code version that created the segment.
- SegMinVersion is the minimum code version that contributed documents to the segment.
- SegSize is the number of documents contained in the segment index.
- IsCompoundFile records whether the segment is written as a compound file or not. If this is -1, the segment is not a compound file. If it is 1, the segment is a compound file.
- The Diagnostics Map is privately written by `IndexWriter`, as a debugging aid, for each segment it creates. It includes metadata like the current Lucene version, OS, Java version, why the segment was created (merge, flush, addIndexes), etc.
- Files is a list of files referred to by this segment.

See Also:
  - `SegmentInfos`
WARNING: This API is experimental and might change in incompatible ways in the next release.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `SI_EXTENSION`
  File extension used to store `SegmentInfo`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Lucene90SegmentInfoFormat()`
  Sole constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `SegmentInfo`
  `read(Directory dir, String segment, byte[] segmentID, IOContext context)`
  `void`
  `write(Directory dir, SegmentInfo si, IOContext ioContext)`

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

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

- ## Field Details

  - ### SI_EXTENSION

    public static final String SI_EXTENSION
    File extension used to store `SegmentInfo`.
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### Lucene90SegmentInfoFormat

    public Lucene90SegmentInfoFormat()
    Sole constructor.

- ## Method Details

  - ### read

    public SegmentInfo read(Directory dir, String segment, byte[] segmentID, IOContext context) throws IOException
    Specified by:
      `read` in class `SegmentInfoFormat`
    Throws:
      `IOException`

  - ### write

    public void write(Directory dir, SegmentInfo si, IOContext ioContext) throws IOException
    Specified by:
      `write` in class `SegmentInfoFormat`
    Throws:
      `IOException`