Show / Hide Table of Contents

    Class LuceneTestCase

    LUCENENET specific extensions to LuceneTestCase to make it easier to port tests from Java with fewer changes.

    Inheritance
    System.Object
    LuceneTestCase
    BaseTokenStreamTestCase
    CollationTestBase
    BaseIndexFileFormatTestCase
    BaseMergePolicyTestCase
    ThreadedIndexingAndSearchingTestCase
    SearchEquivalenceTestBase
    ShardSearchingTestBase
    BaseDirectoryTestCase
    ApiScanTestBase
    ExceptionSerializationTestBase
    BaseDocIdSetTestCase<T>
    Namespace: Lucene.Net.Util
    Assembly: Lucene.Net.TestFramework.dll
    Syntax
    public abstract class LuceneTestCase : object

    Fields

    | Improve this Doc View Source

    DEFAULT_LINE_DOCS_FILE

    TODO: javadoc?

    Declaration
    public static readonly string DEFAULT_LINE_DOCS_FILE
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    INFOSTREAM

    TODO: javadoc?

    Declaration
    public static readonly bool INFOSTREAM
    Field Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    JENKINS_LARGE_LINE_DOCS_FILE

    TODO: javadoc?

    Declaration
    public static readonly string JENKINS_LARGE_LINE_DOCS_FILE
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    LEAVE_TEMPORARY

    Leave temporary files on disk, even on successful runs.

    Declaration
    public static readonly bool LEAVE_TEMPORARY
    Field Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    RANDOM_MULTIPLIER

    A random multiplier which you should use when writing random tests: multiply it by the number of iterations to scale your tests (for nightly builds).

    Declaration
    public static readonly int RANDOM_MULTIPLIER
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    SuiteFailureMarker

    Suite failure marker (any error in the test or suite scope).

    Declaration
    public static readonly bool SuiteFailureMarker
    Field Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    TEST_CODEC

    Gets the codec to run tests with.

    Declaration
    public static readonly string TEST_CODEC
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    TEST_DIRECTORY

    Gets the directory to run tests with

    Declaration
    public static readonly string TEST_DIRECTORY
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    TEST_DOCVALUESFORMAT

    Gets the docValuesFormat to run tests with

    Declaration
    public static readonly string TEST_DOCVALUESFORMAT
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    TEST_LINE_DOCS_FILE

    The line file used by LineFileDocs

    Declaration
    public static readonly string TEST_LINE_DOCS_FILE
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    TEST_POSTINGSFORMAT

    Gets the postingsFormat to run tests with.

    Declaration
    public static readonly string TEST_POSTINGSFORMAT
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    TEST_VERSION_CURRENT

    Use this constant when creating Analyzers and any other version-dependent stuff.

    NOTE: Change this when development starts for new Lucene version:

    Declaration
    public static readonly LuceneVersion TEST_VERSION_CURRENT
    Field Value
    Type Description
    LuceneVersion
    | Improve this Doc View Source

    VERBOSE

    True if and only if tests are run in verbose mode. If this flag is false tests are not expected to print any messages.

    Declaration
    public static readonly bool VERBOSE
    Field Value
    Type Description
    System.Boolean

    Properties

    | Improve this Doc View Source

    CodecFactory

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

    DefaultCodecSupportsDocsWithField

    Returns true if the codec "supports" docsWithField (other codecs return MatchAllBits, because you couldnt write missing values before)

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

    DefaultCodecSupportsDocValues

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

    DefaultCodecSupportsFieldUpdates

    Returns true if the codec "supports" field updates.

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

    DefaultCodecSupportsMissingDocValues

    Returns true if the default codec supports single valued docvalues with missing values

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

    DefaultCodecSupportsSortedSet

    Returns true if the default codec supports SORTED_SET docvalues

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

    DocValuesFormatFactory

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

    DoesntSupportOffsets

    Declaration
    protected static ICollection<string> DoesntSupportOffsets { get; }
    Property Value
    Type Description
    ICollection<System.String>
    | Improve this Doc View Source

    OldFormatImpersonationIsActive

    When true, Codecs for old Lucene version will support writing indexes in that format. Defaults to false, can be disabled by specific tests on demand.

    This is a Lucene.NET INTERNAL API, use at your own risk
    Declaration
    public static bool OldFormatImpersonationIsActive { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    PostingsFormatFactory

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

    Random

    Access to the current instance. It is safe to use this method from multiple threads, etc., but it should be called while within a runner's scope (so no static initializers). The returned instance will be different when this method is called inside a BeforeClass() hook (static suite scope) and within / hooks or test methods.

    The returned instance must not be shared with other threads or cross a single scope's boundary. For example, a acquired within a test method shouldn't be reused for another test case.

    There is an overhead connected with getting the for a particular context and thread. It is better to cache the locally if tight loops with multiple invocations are present or create a derivative local for millions of calls like this:

    Random random = new Random(Random.Next());
    // tight loop with many invocations.
    Declaration
    public static Random Random { get; }
    Property Value
    Type Description
    Random
    | Improve this Doc View Source

    TestName

    Return the name of the currently executing test case.

    Declaration
    public virtual string TestName { get; }
    Property Value
    Type Description
    System.String

    Methods

    | Improve this Doc View Source

    AfterClass()

    Tears down random defaults and cleans up temporary files.

    If you override this method, be sure to call base.AfterClass() AFTER tearing down your test fixture.

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

    AssertDeletedDocsEquals(String, IndexReader, IndexReader)

    Declaration
    public virtual void AssertDeletedDocsEquals(string info, IndexReader leftReader, IndexReader rightReader)
    Parameters
    Type Name Description
    System.String info
    IndexReader leftReader
    IndexReader rightReader
    | Improve this Doc View Source

    AssertDocsAndPositionsEnumEquals(String, DocsAndPositionsEnum, DocsAndPositionsEnum)

    Checks docs + freqs + positions + payloads, sequentially.

    Declaration
    public virtual void AssertDocsAndPositionsEnumEquals(string info, DocsAndPositionsEnum leftDocs, DocsAndPositionsEnum rightDocs)
    Parameters
    Type Name Description
    System.String info
    DocsAndPositionsEnum leftDocs
    DocsAndPositionsEnum rightDocs
    | Improve this Doc View Source

    AssertDocsEnumEquals(String, DocsEnum, DocsEnum, Boolean)

    Checks docs + freqs, sequentially.

    Declaration
    public virtual void AssertDocsEnumEquals(string info, DocsEnum leftDocs, DocsEnum rightDocs, bool hasFreqs)
    Parameters
    Type Name Description
    System.String info
    DocsEnum leftDocs
    DocsEnum rightDocs
    System.Boolean hasFreqs
    | Improve this Doc View Source

    AssertDocsSkippingEquals(String, IndexReader, Int32, DocsEnum, DocsEnum, Boolean)

    Checks advancing docs.

    Declaration
    public virtual void AssertDocsSkippingEquals(string info, IndexReader leftReader, int docFreq, DocsEnum leftDocs, DocsEnum rightDocs, bool hasFreqs)
    Parameters
    Type Name Description
    System.String info
    IndexReader leftReader
    System.Int32 docFreq
    DocsEnum leftDocs
    DocsEnum rightDocs
    System.Boolean hasFreqs
    | Improve this Doc View Source

    AssertDocValuesEquals(String, IndexReader, IndexReader)

    Checks that docvalues across all fields are equivalent.

    Declaration
    public virtual void AssertDocValuesEquals(string info, IndexReader leftReader, IndexReader rightReader)
    Parameters
    Type Name Description
    System.String info
    IndexReader leftReader
    IndexReader rightReader
    | Improve this Doc View Source

    AssertDocValuesEquals(String, Int32, NumericDocValues, NumericDocValues)

    Declaration
    public virtual void AssertDocValuesEquals(string info, int num, NumericDocValues leftDocValues, NumericDocValues rightDocValues)
    Parameters
    Type Name Description
    System.String info
    System.Int32 num
    NumericDocValues leftDocValues
    NumericDocValues rightDocValues
    | Improve this Doc View Source

    AssertFieldInfosEquals(String, IndexReader, IndexReader)

    Declaration
    public virtual void AssertFieldInfosEquals(string info, IndexReader leftReader, IndexReader rightReader)
    Parameters
    Type Name Description
    System.String info
    IndexReader leftReader
    IndexReader rightReader
    | Improve this Doc View Source

    AssertFieldsEquals(String, IndexReader, Fields, Fields, Boolean)

    Fields API equivalency.

    Declaration
    public virtual void AssertFieldsEquals(string info, IndexReader leftReader, Fields leftFields, Fields rightFields, bool deep)
    Parameters
    Type Name Description
    System.String info
    IndexReader leftReader
    Fields leftFields
    Fields rightFields
    System.Boolean deep
    | Improve this Doc View Source

    AssertFieldStatisticsEquals(String, Fields, Fields)

    Checks that top-level statistics on are the same.

    Declaration
    public virtual void AssertFieldStatisticsEquals(string info, Fields leftFields, Fields rightFields)
    Parameters
    Type Name Description
    System.String info
    Fields leftFields
    Fields rightFields
    | Improve this Doc View Source

    AssertNormsEquals(String, IndexReader, IndexReader)

    Checks that norms are the same across all fields.

    Declaration
    public virtual void AssertNormsEquals(string info, IndexReader leftReader, IndexReader rightReader)
    Parameters
    Type Name Description
    System.String info
    IndexReader leftReader
    IndexReader rightReader
    | Improve this Doc View Source

    AssertPositionsSkippingEquals(String, IndexReader, Int32, DocsAndPositionsEnum, DocsAndPositionsEnum)

    Checks advancing docs + positions.

    Declaration
    public virtual void AssertPositionsSkippingEquals(string info, IndexReader leftReader, int docFreq, DocsAndPositionsEnum leftDocs, DocsAndPositionsEnum rightDocs)
    Parameters
    Type Name Description
    System.String info
    IndexReader leftReader
    System.Int32 docFreq
    DocsAndPositionsEnum leftDocs
    DocsAndPositionsEnum rightDocs
    | Improve this Doc View Source

    AssertReaderEquals(String, IndexReader, IndexReader)

    Declaration
    public virtual void AssertReaderEquals(string info, IndexReader leftReader, IndexReader rightReader)
    Parameters
    Type Name Description
    System.String info
    IndexReader leftReader
    IndexReader rightReader
    | Improve this Doc View Source

    AssertReaderStatisticsEquals(String, IndexReader, IndexReader)

    Checks that reader-level statistics are the same.

    Declaration
    public virtual void AssertReaderStatisticsEquals(string info, IndexReader leftReader, IndexReader rightReader)
    Parameters
    Type Name Description
    System.String info
    IndexReader leftReader
    IndexReader rightReader
    | Improve this Doc View Source

    AssertSaneFieldCaches(String)

    Asserts that does not detect any problems with .

    If any problems are found, they are logged to (allong with the msg) when the Assertion is thrown.

    This method is called by TearDown() after every test method, however s scoped inside test methods may be garbage collected prior to this method being called, causing errors to be overlooked. Tests are encouraged to keep their s scoped at the class level, or to explicitly call this method directly in the same scope as the .

    Declaration
    protected static void AssertSaneFieldCaches(string msg)
    Parameters
    Type Name Description
    System.String msg
    | Improve this Doc View Source

    AssertStoredFieldEquals(String, IIndexableField, IIndexableField)

    Checks that two stored fields are equivalent.

    Declaration
    public virtual void AssertStoredFieldEquals(string info, IIndexableField leftField, IIndexableField rightField)
    Parameters
    Type Name Description
    System.String info
    IIndexableField leftField
    IIndexableField rightField
    | Improve this Doc View Source

    AssertStoredFieldsEquals(String, IndexReader, IndexReader)

    Checks that stored fields of all documents are the same.

    Declaration
    public virtual void AssertStoredFieldsEquals(string info, IndexReader leftReader, IndexReader rightReader)
    Parameters
    Type Name Description
    System.String info
    IndexReader leftReader
    IndexReader rightReader
    | Improve this Doc View Source

    AssertTermsEnumEquals(String, IndexReader, TermsEnum, TermsEnum, Boolean)

    Checks the terms enum sequentially. If deep is false, it does a 'shallow' test that doesnt go down to the docsenums.

    Declaration
    public virtual void AssertTermsEnumEquals(string info, IndexReader leftReader, TermsEnum leftTermsEnum, TermsEnum rightTermsEnum, bool deep)
    Parameters
    Type Name Description
    System.String info
    IndexReader leftReader
    TermsEnum leftTermsEnum
    TermsEnum rightTermsEnum
    System.Boolean deep
    | Improve this Doc View Source

    AssertTermsEquals(String, IndexReader, Terms, Terms, Boolean)

    API equivalency.

    Declaration
    public virtual void AssertTermsEquals(string info, IndexReader leftReader, Terms leftTerms, Terms rightTerms, bool deep)
    Parameters
    Type Name Description
    System.String info
    IndexReader leftReader
    Terms leftTerms
    Terms rightTerms
    System.Boolean deep
    | Improve this Doc View Source

    AssertTermsStatisticsEquals(String, Terms, Terms)

    Checks collection-level statistics on .

    Declaration
    public virtual void AssertTermsStatisticsEquals(string info, Terms leftTerms, Terms rightTerms)
    Parameters
    Type Name Description
    System.String info
    Terms leftTerms
    Terms rightTerms
    | Improve this Doc View Source

    AssertTermStatsEquals(String, TermsEnum, TermsEnum)

    Checks term-level statistics.

    Declaration
    public virtual void AssertTermStatsEquals(string info, TermsEnum leftTermsEnum, TermsEnum rightTermsEnum)
    Parameters
    Type Name Description
    System.String info
    TermsEnum leftTermsEnum
    TermsEnum rightTermsEnum
    | Improve this Doc View Source

    AssertTermVectorsEquals(String, IndexReader, IndexReader)

    Checks that term vectors across all fields are equivalent.

    Declaration
    public virtual void AssertTermVectorsEquals(string info, IndexReader leftReader, IndexReader rightReader)
    Parameters
    Type Name Description
    System.String info
    IndexReader leftReader
    IndexReader rightReader
    | Improve this Doc View Source

    AsSet(Object[])

    Return args as a instance. The order of elements is not preserved in enumerators.

    Declaration
    public static ISet<object> AsSet(params object[] args)
    Parameters
    Type Name Description
    System.Object[] args
    Returns
    Type Description
    ISet<System.Object>
    | Improve this Doc View Source

    AssumeFalse(String, Boolean)

    Declaration
    public static void AssumeFalse(string msg, bool condition)
    Parameters
    Type Name Description
    System.String msg
    System.Boolean condition
    | Improve this Doc View Source

    AssumeNoException(String, Exception)

    Declaration
    public static void AssumeNoException(string msg, Exception e)
    Parameters
    Type Name Description
    System.String msg
    Exception e
    | Improve this Doc View Source

    AssumeTrue(String, Boolean)

    Declaration
    public static void AssumeTrue(string msg, bool condition)
    Parameters
    Type Name Description
    System.String msg
    System.Boolean condition
    | Improve this Doc View Source

    AtLeast(Random, Int32)

    Returns a number of at least i

    The actual number returned will be influenced by whether Lucene.Net.Util.LuceneTestCase.TEST_NIGHTLY is active and RANDOM_MULTIPLIER, but also with some random fudge.

    Declaration
    public static int AtLeast(Random random, int i)
    Parameters
    Type Name Description
    Random random
    System.Int32 i
    Returns
    Type Description
    System.Int32
    | Improve this Doc View Source

    AtLeast(Int32)

    Declaration
    public static int AtLeast(int i)
    Parameters
    Type Name Description
    System.Int32 i
    Returns
    Type Description
    System.Int32
    | Improve this Doc View Source

    BeforeClass()

    Sets up dependency injection of codec factories for running the test class, and also picks random defaults for culture, time zone, similarity, and default codec.

    If you override this method, be sure to call base.BeforeClass() BEFORE setting up your test fixture.

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

    CreateTempDir()

    Creates an empty, temporary folder (when the name of the folder is of no importance).

    Declaration
    public static DirectoryInfo CreateTempDir()
    Returns
    Type Description
    DirectoryInfo
    See Also
    CreateTempDir(String)
    | Improve this Doc View Source

    CreateTempDir(String)

    Creates an empty, temporary folder with the given name prefix under the system's .

    The folder will be automatically removed after the test class completes successfully. The test should close any file handles that would prevent the folder from being removed.

    Declaration
    public static DirectoryInfo CreateTempDir(string prefix)
    Parameters
    Type Name Description
    System.String prefix
    Returns
    Type Description
    DirectoryInfo
    | Improve this Doc View Source

    CreateTempFile()

    Creates an empty temporary file.

    Declaration
    public static FileInfo CreateTempFile()
    Returns
    Type Description
    FileInfo
    | Improve this Doc View Source

    CreateTempFile(String, String)

    Creates an empty file with the given prefix and suffix under the system's .

    The file will be automatically removed after the test class completes successfully. The test should close any file handles that would prevent the folder from being removed.

    Declaration
    public static FileInfo CreateTempFile(string prefix, string suffix)
    Parameters
    Type Name Description
    System.String prefix
    System.String suffix
    Returns
    Type Description
    FileInfo
    | Improve this Doc View Source

    CultureForName(String)

    return a object equivalent to its programmatic name.

    Declaration
    public static CultureInfo CultureForName(string localeName)
    Parameters
    Type Name Description
    System.String localeName
    Returns
    Type Description
    CultureInfo
    | Improve this Doc View Source

    DumpArray(String, Object[], TextWriter)

    Convenience method for logging an array. Wraps the array in an enumerator and delegates to DumpEnumerator(String, IEnumerator, TextWriter)

    Declaration
    public static void DumpArray(string label, object[] objs, TextWriter stream)
    Parameters
    Type Name Description
    System.String label
    System.Object[] objs
    TextWriter stream
    See Also
    DumpEnumerator(String, IEnumerator, TextWriter)
    | Improve this Doc View Source

    DumpEnumerator(String, IEnumerator, TextWriter)

    Convenience method for logging an enumerator.

    Declaration
    public static void DumpEnumerator(string label, IEnumerator iter, TextWriter stream)
    Parameters
    Type Name Description
    System.String label

    String logged before/after the items in the enumerator.

    IEnumerator iter

    Each element is ToString()ed and logged on it's own line. If iter is null this is logged differnetly then an empty enumerator.

    TextWriter stream

    Stream to log messages to.

    | Improve this Doc View Source

    GetDataFile(String)

    Gets a resource from the classpath as . This method should only be used, if a real file is needed. To get a stream, code should prefer using this.GetType().Assembly and this.GetType().

    Declaration
    protected virtual Stream GetDataFile(string name)
    Parameters
    Type Name Description
    System.String name
    Returns
    Type Description
    Stream
    | Improve this Doc View Source

    GetFullMethodName(String)

    Declaration
    protected string GetFullMethodName(string memberName = "")
    Parameters
    Type Name Description
    System.String memberName
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    GetOnlySegmentReader(DirectoryReader)

    Some tests expect the directory to contain a single segment, and want to do tests on that segment's reader. This is an utility method to help them.

    Declaration
    public static SegmentReader GetOnlySegmentReader(DirectoryReader reader)
    Parameters
    Type Name Description
    DirectoryReader reader
    Returns
    Type Description
    SegmentReader
    | Improve this Doc View Source

    GetTestClass()

    Return the current type being tested.

    Declaration
    public static Type GetTestClass()
    Returns
    Type Description
    Type
    | Improve this Doc View Source

    MaybeWrapReader(IndexReader)

    Sometimes wrap the as slow, parallel or filter reader (or combinations of that)

    Declaration
    public static IndexReader MaybeWrapReader(IndexReader r)
    Parameters
    Type Name Description
    IndexReader r
    Returns
    Type Description
    IndexReader
    | Improve this Doc View Source

    NewAlcoholicMergePolicy()

    Declaration
    public static AlcoholicMergePolicy NewAlcoholicMergePolicy()
    Returns
    Type Description
    AlcoholicMergePolicy
    | Improve this Doc View Source

    NewAlcoholicMergePolicy(Random, TimeZoneInfo)

    Declaration
    public static AlcoholicMergePolicy NewAlcoholicMergePolicy(Random random, TimeZoneInfo timeZone)
    Parameters
    Type Name Description
    Random random
    TimeZoneInfo timeZone
    Returns
    Type Description
    AlcoholicMergePolicy
    | Improve this Doc View Source

    NewDirectory()

    Returns a new instance. Use this when the test does not care about the specific implementation (most tests).

    The is wrapped with BaseDirectoryWrapper. This means usually it will be picky, such as ensuring that you properly dispose it and close all open files in your test. It will emulate some features of Windows, such as not allowing open files to be overwritten.

    Declaration
    public static BaseDirectoryWrapper NewDirectory()
    Returns
    Type Description
    BaseDirectoryWrapper
    | Improve this Doc View Source

    NewDirectory(Directory)

    Returns a new instance, with contents copied from the provided directory. See NewDirectory() for more information.

    Declaration
    public static BaseDirectoryWrapper NewDirectory(Directory d)
    Parameters
    Type Name Description
    Directory d
    Returns
    Type Description
    BaseDirectoryWrapper
    | Improve this Doc View Source

    NewDirectory(Random)

    Returns a new instance, using the specified random. See NewDirectory() for more information.

    Declaration
    public static BaseDirectoryWrapper NewDirectory(Random random)
    Parameters
    Type Name Description
    Random random
    Returns
    Type Description
    BaseDirectoryWrapper
    | Improve this Doc View Source

    NewDirectory(Random, Directory)

    Returns a new instance, using the specified random with contents copied from the provided directory. See NewDirectory() for more information.

    Declaration
    public static BaseDirectoryWrapper NewDirectory(Random random, Directory directory)
    Parameters
    Type Name Description
    Random random
    Directory directory
    Returns
    Type Description
    BaseDirectoryWrapper
    | Improve this Doc View Source

    NewField(Random, String, String, FieldType)

    Declaration
    public static Field NewField(Random random, string name, string value, FieldType type)
    Parameters
    Type Name Description
    Random random
    System.String name
    System.String value
    FieldType type
    Returns
    Type Description
    Field
    | Improve this Doc View Source

    NewField(String, String, FieldType)

    Declaration
    public static Field NewField(string name, string value, FieldType type)
    Parameters
    Type Name Description
    System.String name
    System.String value
    FieldType type
    Returns
    Type Description
    Field
    | Improve this Doc View Source

    NewFSDirectory(DirectoryInfo)

    Returns a new instance over the given file, which must be a folder.

    Declaration
    public static BaseDirectoryWrapper NewFSDirectory(DirectoryInfo d)
    Parameters
    Type Name Description
    DirectoryInfo d
    Returns
    Type Description
    BaseDirectoryWrapper
    | Improve this Doc View Source

    NewFSDirectory(DirectoryInfo, LockFactory)

    Returns a new instance over the given file, which must be a folder.

    Declaration
    public static BaseDirectoryWrapper NewFSDirectory(DirectoryInfo d, LockFactory lf)
    Parameters
    Type Name Description
    DirectoryInfo d
    LockFactory lf
    Returns
    Type Description
    BaseDirectoryWrapper
    | Improve this Doc View Source

    NewIndexWriterConfig(LuceneVersion, Analyzer)

    Create a new with random defaults.

    Declaration
    public static IndexWriterConfig NewIndexWriterConfig(LuceneVersion v, Analyzer a)
    Parameters
    Type Name Description
    LuceneVersion v
    Analyzer a
    Returns
    Type Description
    IndexWriterConfig
    | Improve this Doc View Source

    NewIndexWriterConfig(Random, LuceneVersion, Analyzer)

    Create a new with random defaults using the specified random.

    Declaration
    public static IndexWriterConfig NewIndexWriterConfig(Random random, LuceneVersion v, Analyzer a)
    Parameters
    Type Name Description
    Random random

    A random instance (usually Random).

    LuceneVersion v
    Analyzer a
    Returns
    Type Description
    IndexWriterConfig
    | Improve this Doc View Source

    NewIOContext(Random)

    TODO: javadoc

    Declaration
    public static IOContext NewIOContext(Random random)
    Parameters
    Type Name Description
    Random random
    Returns
    Type Description
    IOContext
    | Improve this Doc View Source

    NewIOContext(Random, IOContext)

    TODO: javadoc

    Declaration
    public static IOContext NewIOContext(Random random, IOContext oldContext)
    Parameters
    Type Name Description
    Random random
    IOContext oldContext
    Returns
    Type Description
    IOContext
    | Improve this Doc View Source

    NewLogMergePolicy()

    Declaration
    public static LogMergePolicy NewLogMergePolicy()
    Returns
    Type Description
    LogMergePolicy
    | Improve this Doc View Source

    NewLogMergePolicy(Random)

    Declaration
    public static LogMergePolicy NewLogMergePolicy(Random random)
    Parameters
    Type Name Description
    Random random
    Returns
    Type Description
    LogMergePolicy
    | Improve this Doc View Source

    NewLogMergePolicy(Boolean)

    Declaration
    public static MergePolicy NewLogMergePolicy(bool useCFS)
    Parameters
    Type Name Description
    System.Boolean useCFS
    Returns
    Type Description
    MergePolicy
    | Improve this Doc View Source

    NewLogMergePolicy(Boolean, Int32)

    Declaration
    public static MergePolicy NewLogMergePolicy(bool useCFS, int mergeFactor)
    Parameters
    Type Name Description
    System.Boolean useCFS
    System.Int32 mergeFactor
    Returns
    Type Description
    MergePolicy
    | Improve this Doc View Source

    NewLogMergePolicy(Int32)

    Declaration
    public static MergePolicy NewLogMergePolicy(int mergeFactor)
    Parameters
    Type Name Description
    System.Int32 mergeFactor
    Returns
    Type Description
    MergePolicy
    | Improve this Doc View Source

    NewMergePolicy()

    Declaration
    public static MergePolicy NewMergePolicy()
    Returns
    Type Description
    MergePolicy
    | Improve this Doc View Source

    NewMergePolicy(Random)

    Declaration
    public static MergePolicy NewMergePolicy(Random r)
    Parameters
    Type Name Description
    Random r
    Returns
    Type Description
    MergePolicy
    | Improve this Doc View Source

    NewMockDirectory()

    Declaration
    public static MockDirectoryWrapper NewMockDirectory()
    Returns
    Type Description
    MockDirectoryWrapper
    | Improve this Doc View Source

    NewMockDirectory(Random)

    Declaration
    public static MockDirectoryWrapper NewMockDirectory(Random random)
    Parameters
    Type Name Description
    Random random
    Returns
    Type Description
    MockDirectoryWrapper
    | Improve this Doc View Source

    NewMockFSDirectory(DirectoryInfo)

    Declaration
    public static MockDirectoryWrapper NewMockFSDirectory(DirectoryInfo d)
    Parameters
    Type Name Description
    DirectoryInfo d
    Returns
    Type Description
    MockDirectoryWrapper
    | Improve this Doc View Source

    NewSearcher(IndexReader)

    Create a new searcher over the reader. this searcher might randomly use threads.

    Declaration
    public static IndexSearcher NewSearcher(IndexReader r)
    Parameters
    Type Name Description
    IndexReader r
    Returns
    Type Description
    IndexSearcher
    | Improve this Doc View Source

    NewSearcher(IndexReader, Boolean)

    Create a new searcher over the reader. This searcher might randomly use threads.

    Declaration
    public static IndexSearcher NewSearcher(IndexReader r, bool maybeWrap)
    Parameters
    Type Name Description
    IndexReader r
    System.Boolean maybeWrap
    Returns
    Type Description
    IndexSearcher
    | Improve this Doc View Source

    NewSearcher(IndexReader, Boolean, Boolean)

    Create a new searcher over the reader. This searcher might randomly use threads. If maybeWrap is true, this searcher might wrap the reader with one that returns null for . If wrapWithAssertions is true, this searcher might be an AssertingIndexSearcher instance.

    Declaration
    public static IndexSearcher NewSearcher(IndexReader r, bool maybeWrap, bool wrapWithAssertions)
    Parameters
    Type Name Description
    IndexReader r
    System.Boolean maybeWrap
    System.Boolean wrapWithAssertions
    Returns
    Type Description
    IndexSearcher
    | Improve this Doc View Source

    NewStringField(Random, String, String, Field.Store)

    Declaration
    public static Field NewStringField(Random random, string name, string value, Field.Store stored)
    Parameters
    Type Name Description
    Random random
    System.String name
    System.String value
    Field.Store stored
    Returns
    Type Description
    Field
    | Improve this Doc View Source

    NewStringField(String, String, Field.Store)

    Declaration
    public static Field NewStringField(string name, string value, Field.Store stored)
    Parameters
    Type Name Description
    System.String name
    System.String value
    Field.Store stored
    Returns
    Type Description
    Field
    | Improve this Doc View Source

    NewTextField(Random, String, String, Field.Store)

    Declaration
    public static Field NewTextField(Random random, string name, string value, Field.Store stored)
    Parameters
    Type Name Description
    Random random
    System.String name
    System.String value
    Field.Store stored
    Returns
    Type Description
    Field
    | Improve this Doc View Source

    NewTextField(String, String, Field.Store)

    Declaration
    public static Field NewTextField(string name, string value, Field.Store stored)
    Parameters
    Type Name Description
    System.String name
    System.String value
    Field.Store stored
    Returns
    Type Description
    Field
    | Improve this Doc View Source

    NewTieredMergePolicy()

    Declaration
    public static TieredMergePolicy NewTieredMergePolicy()
    Returns
    Type Description
    TieredMergePolicy
    | Improve this Doc View Source

    NewTieredMergePolicy(Random)

    Declaration
    public static TieredMergePolicy NewTieredMergePolicy(Random random)
    Parameters
    Type Name Description
    Random random
    Returns
    Type Description
    TieredMergePolicy
    | Improve this Doc View Source

    RandomCulture(Random)

    Return a random from the available cultures on the system.

    See https://issues.apache.org/jira/browse/LUCENE-4020.

    Declaration
    public static CultureInfo RandomCulture(Random random)
    Parameters
    Type Name Description
    Random random
    Returns
    Type Description
    CultureInfo
    | Improve this Doc View Source

    RandomGaussian()

    Returns the next pseudorandom, Gaussian ("normally") distributed double value with mean 0.0 and standard deviation 1.0 from this random number generator's sequence.

    The general contract of nextGaussian is that one value, chosen from (approximately) the usual normal distribution with mean 0.0 and standard deviation 1.0, is pseudorandomly generated and returned.

    This uses the polar method of G. E. P. Box, M. E. Muller, and G. Marsaglia, as described by Donald E. Knuth in The Art of Computer Programming, Volume 3: Seminumerical Algorithms, section 3.4.1, subsection C, algorithm P. Note that it generates two independent values at the cost of only one call to StrictMath.log and one call to StrictMath.sqrt.

    Declaration
    public double RandomGaussian()
    Returns
    Type Description
    System.Double

    The next pseudorandom, Gaussian ("normally") distributed value with mean 0.0 and standard deviation 1.0 from this random number generator's sequence.

    | Improve this Doc View Source

    RandomTimeZone(Random)

    Return a random from the available timezones on the system

    See https://issues.apache.org/jira/browse/LUCENE-4020.

    Declaration
    public static TimeZoneInfo RandomTimeZone(Random random)
    Parameters
    Type Name Description
    Random random
    Returns
    Type Description
    TimeZoneInfo
    | Improve this Doc View Source

    Rarely()

    Declaration
    public static bool Rarely()
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Rarely(Random)

    Returns true if something should happen rarely,

    The actual number returned will be influenced by whether Lucene.Net.Util.LuceneTestCase.TEST_NIGHTLY is active and RANDOM_MULTIPLIER.

    Declaration
    public static bool Rarely(Random random)
    Parameters
    Type Name Description
    Random random
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    SetUp()

    For subclasses to override. Overrides must call base.SetUp().

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

    SlowFileExists(Directory, String)

    Returns true if the file exists (can be opened), false if it cannot be opened, and (unlike .NET's ) if there's some unexpected error.

    Declaration
    public static bool SlowFileExists(Directory dir, string fileName)
    Parameters
    Type Name Description
    Directory dir
    System.String fileName
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    TearDown()

    For subclasses to override. Overrides must call base.TearDown().

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

    Usually()

    Declaration
    public static bool Usually()
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Usually(Random)

    Declaration
    public static bool Usually(Random random)
    Parameters
    Type Name Description
    Random random
    Returns
    Type Description
    System.Boolean
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)