Show / Hide Table of Contents

    Class RandomIndexWriter

    Silly class that randomizes the indexing experience. EG it may swap in a different merge policy/scheduler; may commit periodically; may or may not forceMerge in the end, may flush by doc count instead of RAM, etc.

    Inheritance
    System.Object
    RandomIndexWriter
    Namespace: Lucene.Net.Index
    Assembly: Lucene.Net.TestFramework.dll
    Syntax
    public class RandomIndexWriter : IDisposable

    Constructors

    | Improve this Doc View Source

    RandomIndexWriter(Random, Directory)

    Create a RandomIndexWriter with a random config: Uses TEST_VERSION_CURRENT and MockAnalyzer.

    Declaration
    public RandomIndexWriter(Random r, Directory dir)
    Parameters
    Type Name Description
    Random r
    Directory dir
    | Improve this Doc View Source

    RandomIndexWriter(Random, Directory, Analyzer)

    Create a RandomIndexWriter with a random config: Uses TEST_VERSION_CURRENT.

    Declaration
    public RandomIndexWriter(Random r, Directory dir, Analyzer a)
    Parameters
    Type Name Description
    Random r
    Directory dir
    Analyzer a
    | Improve this Doc View Source

    RandomIndexWriter(Random, Directory, IndexWriterConfig)

    Creates a RandomIndexWriter with the provided config

    Declaration
    public RandomIndexWriter(Random r, Directory dir, IndexWriterConfig c)
    Parameters
    Type Name Description
    Random r
    Directory dir
    IndexWriterConfig c
    | Improve this Doc View Source

    RandomIndexWriter(Random, Directory, LuceneVersion, Analyzer)

    Creates a RandomIndexWriter with a random config.

    Declaration
    public RandomIndexWriter(Random r, Directory dir, LuceneVersion v, Analyzer a)
    Parameters
    Type Name Description
    Random r
    Directory dir
    LuceneVersion v
    Analyzer a

    Properties

    | Improve this Doc View Source

    DoRandomForceMerge

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

    DoRandomForceMergeAssert

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

    IndexWriter

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

    MaxDoc

    Declaration
    public virtual int MaxDoc { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    NumDocs

    Declaration
    public virtual int NumDocs { get; }
    Property Value
    Type Description
    System.Int32

    Methods

    | Improve this Doc View Source

    AddDocument(IEnumerable<IIndexableField>)

    Adds a Document.

    Declaration
    public virtual void AddDocument(IEnumerable<IIndexableField> doc)
    Parameters
    Type Name Description
    IEnumerable<IIndexableField> doc
    | Improve this Doc View Source

    AddDocument(IEnumerable<IIndexableField>, Analyzer)

    Declaration
    public virtual void AddDocument(IEnumerable<IIndexableField> doc, Analyzer a)
    Parameters
    Type Name Description
    IEnumerable<IIndexableField> doc
    Analyzer a
    | Improve this Doc View Source

    AddDocuments(IEnumerable<IEnumerable<IIndexableField>>)

    Declaration
    public virtual void AddDocuments(IEnumerable<IEnumerable<IIndexableField>> docs)
    Parameters
    Type Name Description
    IEnumerable<IEnumerable<IIndexableField>> docs
    | Improve this Doc View Source

    AddIndexes(Directory[])

    Declaration
    public virtual void AddIndexes(params Directory[] dirs)
    Parameters
    Type Name Description
    Directory[] dirs
    | Improve this Doc View Source

    AddIndexes(IndexReader[])

    Declaration
    public virtual void AddIndexes(params IndexReader[] readers)
    Parameters
    Type Name Description
    IndexReader[] readers
    | Improve this Doc View Source

    Commit()

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

    DeleteAll()

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

    DeleteDocuments(Query)

    Declaration
    public virtual void DeleteDocuments(Query q)
    Parameters
    Type Name Description
    Query q
    | Improve this Doc View Source

    DeleteDocuments(Term)

    Declaration
    public virtual void DeleteDocuments(Term term)
    Parameters
    Type Name Description
    Term term
    | Improve this Doc View Source

    Dispose()

    Dispose this writer.

    Declaration
    public void Dispose()
    | Improve this Doc View Source

    Dispose(Boolean)

    Dispose this writer.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing
    | Improve this Doc View Source

    ForceMerge(Int32)

    Forces a forceMerge.

    NOTE: this should be avoided in tests unless absolutely necessary, as it will result in less test coverage.

    Declaration
    public virtual void ForceMerge(int maxSegmentCount)
    Parameters
    Type Name Description
    System.Int32 maxSegmentCount
    | Improve this Doc View Source

    ForceMergeDeletes()

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

    ForceMergeDeletes(Boolean)

    Declaration
    public virtual void ForceMergeDeletes(bool doWait)
    Parameters
    Type Name Description
    System.Boolean doWait
    | Improve this Doc View Source

    GetReader()

    Declaration
    public virtual DirectoryReader GetReader()
    Returns
    Type Description
    DirectoryReader
    | Improve this Doc View Source

    GetReader(Boolean)

    Declaration
    public virtual DirectoryReader GetReader(bool applyDeletions)
    Parameters
    Type Name Description
    System.Boolean applyDeletions
    Returns
    Type Description
    DirectoryReader
    | Improve this Doc View Source

    MockIndexWriter(Directory, IndexWriterConfig, ITestPoint)

    Declaration
    public static IndexWriter MockIndexWriter(Directory dir, IndexWriterConfig conf, ITestPoint testPoint)
    Parameters
    Type Name Description
    Directory dir
    IndexWriterConfig conf
    ITestPoint testPoint
    Returns
    Type Description
    IndexWriter
    | Improve this Doc View Source

    MockIndexWriter(Directory, IndexWriterConfig, Random)

    Declaration
    public static IndexWriter MockIndexWriter(Directory dir, IndexWriterConfig conf, Random r)
    Parameters
    Type Name Description
    Directory dir
    IndexWriterConfig conf
    Random r
    Returns
    Type Description
    IndexWriter
    | Improve this Doc View Source

    UpdateBinaryDocValue(Term, String, BytesRef)

    Declaration
    public virtual void UpdateBinaryDocValue(Term term, string field, BytesRef value)
    Parameters
    Type Name Description
    Term term
    System.String field
    BytesRef value
    | Improve this Doc View Source

    UpdateDocument(Term, IEnumerable<IIndexableField>)

    Updates a document.

    Declaration
    public virtual void UpdateDocument(Term t, IEnumerable<IIndexableField> doc)
    Parameters
    Type Name Description
    Term t
    IEnumerable<IIndexableField> doc
    | Improve this Doc View Source

    UpdateDocuments(Term, IEnumerable<IEnumerable<IIndexableField>>)

    Declaration
    public virtual void UpdateDocuments(Term delTerm, IEnumerable<IEnumerable<IIndexableField>> docs)
    Parameters
    Type Name Description
    Term delTerm
    IEnumerable<IEnumerable<IIndexableField>> docs
    | Improve this Doc View Source

    UpdateNumericDocValue(Term, String, Nullable<Int64>)

    Declaration
    public virtual void UpdateNumericDocValue(Term term, string field, long? value)
    Parameters
    Type Name Description
    Term term
    System.String field
    System.Nullable<System.Int64> value
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)