Basic tool and API to check the health of an index and write a new segments file that removes reference to problematic segments.

As this tool checks every byte in the index, on a large index it can take quite a long time to run.

WARNING: this tool and API is new and experimental and is subject to suddenly change in the next release. Please make a complete backup of your index before using this to fix your index!

The CheckIndex..::..Status type exposes the following members.

Constructors

  NameDescription
Public methodCheckIndex..::..Status
Initializes a new instance of the CheckIndex..::..Status class

Methods

  NameDescription
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)

Fields

  NameDescription
Public fieldcantOpenSegments
True if we were unable to open the segments_N file.
Public fieldclean
True if no problems were found with the index.
Public fielddir
Directory index is in.
Public fieldmissingSegments
True if we were unable to locate and load the segments_N file.
Public fieldmissingSegmentVersion
True if we were unable to read the version number from segments_N file.
Public fieldnumBadSegments
How many bad segments were found.
Public fieldnumSegments
Number of segments in the index.
Public fieldpartial
True if we checked only specific segments ({@link #CheckIndex(List)}) was called with non-null argument).
Public fieldsegmentFormat
String description of the version of the index.
Public fieldsegmentInfos
List of {@link SegmentInfoStatus} instances, detailing status of each segment.
Public fieldsegmentsChecked
Empty unless you passed specific segments list to check as optional 3rd argument.
Public fieldsegmentsFileName
Name of latest segments_N file in the index.
Public fieldtoolOutOfDate
True if the index was created with a newer version of Lucene than the CheckIndex tool.
Public fieldtotLoseDocCount
How many documents will be lost to bad segments.
Public fielduserData
Holds the userData of the last commit in the index

See Also