CheckIndex

class CheckIndex(dir: Directory, writeLock: Lock = dir.obtainLock(IndexWriter.WRITE_LOCK_NAME)) : AutoCloseable

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.

Constructors

Link copied to clipboard
constructor(dir: Directory, writeLock: Lock = dir.obtainLock(IndexWriter.WRITE_LOCK_NAME))

Types

Link copied to clipboard

The marker RuntimeException used by CheckIndex APIs when index integrity failure is detected.

Link copied to clipboard
object Companion
Link copied to clipboard
Link copied to clipboard
object Level

Class with static variables with information about CheckIndex's -level parameter.

Link copied to clipboard
class Options

Run-time configuration options for CheckIndex commands.

Link copied to clipboard
class Status

Returned from .checkIndex detailing the health and status of the index.

Link copied to clipboard

Walks the entire N-dimensional points space, verifying that all points fall within the last cell's boundaries.

Properties

Link copied to clipboard

If true, just throw the original exception immediately when corruption is detected, rather than continuing to iterate to other segments looking for more corruption.

Functions

Link copied to clipboard
fun checkIndex(onlySegments: MutableList<String>? = null): CheckIndex.Status
fun checkIndex(onlySegments: MutableList<String>?, executorService: ExecutorService?): CheckIndex.Status

Returns a Status instance detailing the state of the index.

Link copied to clipboard
open override fun close()
Link copied to clipboard

Actually perform the index check

Link copied to clipboard

Repairs the index using previously returned result from .checkIndex. Note that this does not remove any of the unreferenced files after it's done; you must separately open an IndexWriter, which deletes unreferenced files when it's created.

Link copied to clipboard
fun getLevel(): Int

See .setLevel.

Link copied to clipboard

Set infoStream where messages should go. See .setInfoStream.

fun setInfoStream(out: PrintStream, verbose: Boolean)

Set infoStream where messages should go. If null, no messages are printed. If verbose is true then more details are printed.

Link copied to clipboard
fun setLevel(v: Int)

Sets Level, the higher the value, the more additional checks are performed. This will likely drastically increase time it takes to run CheckIndex! See Level

Link copied to clipboard

Set threadCount used for parallelizing index integrity checking.