SegmentInfo

class SegmentInfo(dir: Directory, version: Version, minVersion: Version?, name: String, maxDoc: Int, isCompoundFile: Boolean, hasBlocks: Boolean, codec: Codec?, diagnostics: MutableMap<String, String>, id: ByteArray, attributes: MutableMap<String, String>, indexSort: Sort?)

Information about a segment such as its name, directory, and files related to the segment.

Constructors

Link copied to clipboard
constructor(dir: Directory, version: Version, minVersion: Version?, name: String, maxDoc: Int, isCompoundFile: Boolean, hasBlocks: Boolean, codec: Codec?, diagnostics: MutableMap<String, String>, id: ByteArray, attributes: MutableMap<String, String>, indexSort: Sort?)

Types

Link copied to clipboard
object Companion

Return the sort order of this segment, or null if the index has no sort.

Properties

Link copied to clipboard

Returns the internal codec attributes map.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Where this segment resides.

Link copied to clipboard

Returns true if this segment contains documents written as blocks.

Link copied to clipboard
Link copied to clipboard

Return the minimum Lucene version that contributed documents to this segment, or null if it is unknown.

Link copied to clipboard

Unique segment name in the directory.

Link copied to clipboard

Mark whether this segment is stored as a compound file.

Link copied to clipboard

Functions

Link copied to clipboard

Adds or modifies this segment's diagnostics.

Link copied to clipboard
fun addFile(file: String)

Add this file to the set of files written for this segment.

Link copied to clipboard

Add these files to the set of files written for this segment.

Link copied to clipboard
open operator override fun equals(obj: Any?): Boolean

We consider another SegmentInfo instance equal if it has the same dir and same name.

Link copied to clipboard

Return all files referenced by this SegmentInfo.

Link copied to clipboard

Get a codec attribute value, or null if it does not exist

Link copied to clipboard

Return the id that uniquely identifies this segment.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun maxDoc(): Int

Returns number of documents in this segment (deletions are not taken into account).

Link copied to clipboard

strips any segment name from the file, naming it with this segment this is because "segment names" can change, e.g. by addIndexes(Dir)

Link copied to clipboard
fun putAttribute(key: String, value: String): String?

Puts a codec attribute value.

Link copied to clipboard

Sets the files written for this segment.

Link copied to clipboard

Sets the hasBlocks property to true. This setting is viral and can't be unset.

Link copied to clipboard
fun setMaxDoc(maxDoc: Int)
Link copied to clipboard
open override fun toString(): String

fun toString(delCount: Int): String

Used for debugging. Format may suddenly change.