Fork me on GitHub
  • API

    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!

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Inheritance
    System.Object
    CheckIndex
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Lucene.Net.Index
    Assembly: Lucene.Net.dll
    Syntax
    public class CheckIndex

    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
    System.IO.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
    System.Collections.Generic.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
    [STAThread]
    public static void Main(string[] args)
    Parameters
    Type Name Description
    System.String[] args
    | Improve this Doc View Source

    TestDocValues(AtomicReader, TextWriter)

    Test docvalues.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Declaration
    public static CheckIndex.Status.DocValuesStatus TestDocValues(AtomicReader reader, TextWriter infoStream)
    Parameters
    Type Name Description
    AtomicReader reader
    System.IO.TextWriter infoStream
    Returns
    Type Description
    CheckIndex.Status.DocValuesStatus
    | Improve this Doc View Source

    TestFieldNorms(AtomicReader, TextWriter)

    Test field norms.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Declaration
    public static CheckIndex.Status.FieldNormStatus TestFieldNorms(AtomicReader reader, TextWriter infoStream)
    Parameters
    Type Name Description
    AtomicReader reader
    System.IO.TextWriter infoStream
    Returns
    Type Description
    CheckIndex.Status.FieldNormStatus
    | Improve this Doc View Source

    TestPostings(AtomicReader, TextWriter)

    Test the term index.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Declaration
    public static CheckIndex.Status.TermIndexStatus TestPostings(AtomicReader reader, TextWriter infoStream)
    Parameters
    Type Name Description
    AtomicReader reader
    System.IO.TextWriter infoStream
    Returns
    Type Description
    CheckIndex.Status.TermIndexStatus
    | Improve this Doc View Source

    TestPostings(AtomicReader, TextWriter, Boolean)

    Test the term index.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Declaration
    public static CheckIndex.Status.TermIndexStatus TestPostings(AtomicReader reader, TextWriter infoStream, bool verbose)
    Parameters
    Type Name Description
    AtomicReader reader
    System.IO.TextWriter infoStream
    System.Boolean verbose
    Returns
    Type Description
    CheckIndex.Status.TermIndexStatus
    | Improve this Doc View Source

    TestStoredFields(AtomicReader, TextWriter)

    Test stored fields.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Declaration
    public static CheckIndex.Status.StoredFieldStatus TestStoredFields(AtomicReader reader, TextWriter infoStream)
    Parameters
    Type Name Description
    AtomicReader reader
    System.IO.TextWriter infoStream
    Returns
    Type Description
    CheckIndex.Status.StoredFieldStatus
    | Improve this Doc View Source

    TestTermVectors(AtomicReader, TextWriter)

    Test term vectors.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Declaration
    public static CheckIndex.Status.TermVectorStatus TestTermVectors(AtomicReader reader, TextWriter infoStream)
    Parameters
    Type Name Description
    AtomicReader reader
    System.IO.TextWriter infoStream
    Returns
    Type Description
    CheckIndex.Status.TermVectorStatus
    | Improve this Doc View Source

    TestTermVectors(AtomicReader, TextWriter, Boolean, Boolean)

    Test term vectors.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Declaration
    public static CheckIndex.Status.TermVectorStatus TestTermVectors(AtomicReader reader, TextWriter infoStream, bool verbose, bool crossCheckTermVectors)
    Parameters
    Type Name Description
    AtomicReader reader
    System.IO.TextWriter infoStream
    System.Boolean verbose
    System.Boolean crossCheckTermVectors
    Returns
    Type Description
    CheckIndex.Status.TermVectorStatus
    • Improve this Doc
    • View Source
    Back to top Copyright © 2022 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.