Show / Hide Table of Contents

    Class CheckIndex

    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.

    Please make a complete backup of your index before using this to fix your index!

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    Inheritance
    System.Object
    CheckIndex
    Namespace: Lucene.Net.Index
    Assembly: Lucene.Net.dll
    Syntax
    public class CheckIndex : object

    Constructors

    | Improve this Doc View Source

    CheckIndex(Directory)

    Create a new CheckIndex on the directory.

    Declaration
    public CheckIndex(Directory dir)
    Parameters
    Type Name Description
    Directory dir

    Properties

    | Improve this Doc View Source

    CrossCheckTermVectors

    If true, term vectors are compared against postings to make sure they are the same. This will likely drastically increase time it takes to run CheckIndex!

    Declaration
    public virtual bool CrossCheckTermVectors { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    InfoStream

    Gets or Sets infoStream where messages should go. If null, no messages are printed. If InfoStreamIsVerbose is true then more details are printed.

    Declaration
    public virtual TextWriter InfoStream { get; set; }
    Property Value
    Type Description
    TextWriter
    | Improve this Doc View Source

    InfoStreamIsVerbose

    If true, prints more details to the InfoStream, if set.

    Declaration
    public virtual bool InfoStreamIsVerbose { get; set; }
    Property Value
    Type Description
    System.Boolean

    Methods

    | Improve this Doc View Source

    DoCheckIndex()

    Returns a CheckIndex.Status instance detailing the state of the index.

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

    WARNING: make sure you only call this when the index is not opened by any writer.

    Declaration
    public virtual CheckIndex.Status DoCheckIndex()
    Returns
    Type Description
    CheckIndex.Status
    | Improve this Doc View Source

    DoCheckIndex(IList<String>)

    Returns a CheckIndex.Status instance detailing the state of the index.

    Declaration
    public virtual CheckIndex.Status DoCheckIndex(IList<string> onlySegments)
    Parameters
    Type Name Description
    IList<System.String> onlySegments

    list of specific segment names to check

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

    WARNING: make sure you only call this when the index is not opened by any writer.

    Returns
    Type Description
    CheckIndex.Status
    | Improve this Doc View Source

    FixIndex(CheckIndex.Status)

    Repairs the index using previously returned result from DoCheckIndex(). 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.

    WARNING: this writes a new segments file into the index, effectively removing all documents in broken segments from the index. BE CAREFUL.

    WARNING: Make sure you only call this when the index is not opened by any writer.

    Declaration
    public virtual void FixIndex(CheckIndex.Status result)
    Parameters
    Type Name Description
    CheckIndex.Status result
    | Improve this Doc View Source

    FlushInfoStream()

    Declaration
    public virtual void FlushInfoStream()
    | Improve this Doc View Source

    Main(String[])

    Declaration
    public static void Main(string[] args)
    Parameters
    Type Name Description
    System.String[] args
    | Improve this Doc View Source

    TestDocValues(AtomicReader, TextWriter)

    Test docvalues.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    Declaration
    public static CheckIndex.Status.DocValuesStatus TestDocValues(AtomicReader reader, TextWriter infoStream)
    Parameters
    Type Name Description
    AtomicReader reader
    TextWriter infoStream
    Returns
    Type Description
    CheckIndex.Status.DocValuesStatus
    | Improve this Doc View Source

    TestFieldNorms(AtomicReader, TextWriter)

    Test field norms.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    Declaration
    public static CheckIndex.Status.FieldNormStatus TestFieldNorms(AtomicReader reader, TextWriter infoStream)
    Parameters
    Type Name Description
    AtomicReader reader
    TextWriter infoStream
    Returns
    Type Description
    CheckIndex.Status.FieldNormStatus
    | Improve this Doc View Source

    TestPostings(AtomicReader, TextWriter)

    Test the term index.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    Declaration
    public static CheckIndex.Status.TermIndexStatus TestPostings(AtomicReader reader, TextWriter infoStream)
    Parameters
    Type Name Description
    AtomicReader reader
    TextWriter infoStream
    Returns
    Type Description
    CheckIndex.Status.TermIndexStatus
    | Improve this Doc View Source

    TestPostings(AtomicReader, TextWriter, Boolean)

    Test the term index.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    Declaration
    public static CheckIndex.Status.TermIndexStatus TestPostings(AtomicReader reader, TextWriter infoStream, bool verbose)
    Parameters
    Type Name Description
    AtomicReader reader
    TextWriter infoStream
    System.Boolean verbose
    Returns
    Type Description
    CheckIndex.Status.TermIndexStatus
    | Improve this Doc View Source

    TestStoredFields(AtomicReader, TextWriter)

    Test stored fields.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    Declaration
    public static CheckIndex.Status.StoredFieldStatus TestStoredFields(AtomicReader reader, TextWriter infoStream)
    Parameters
    Type Name Description
    AtomicReader reader
    TextWriter infoStream
    Returns
    Type Description
    CheckIndex.Status.StoredFieldStatus
    | Improve this Doc View Source

    TestTermVectors(AtomicReader, TextWriter)

    Test term vectors.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    Declaration
    public static CheckIndex.Status.TermVectorStatus TestTermVectors(AtomicReader reader, TextWriter infoStream)
    Parameters
    Type Name Description
    AtomicReader reader
    TextWriter infoStream
    Returns
    Type Description
    CheckIndex.Status.TermVectorStatus
    | Improve this Doc View Source

    TestTermVectors(AtomicReader, TextWriter, Boolean, Boolean)

    Test term vectors.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    Declaration
    public static CheckIndex.Status.TermVectorStatus TestTermVectors(AtomicReader reader, TextWriter infoStream, bool verbose, bool crossCheckTermVectors)
    Parameters
    Type Name Description
    AtomicReader reader
    TextWriter infoStream
    System.Boolean verbose
    System.Boolean crossCheckTermVectors
    Returns
    Type Description
    CheckIndex.Status.TermVectorStatus
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)