Companion

object Companion

Types

Link copied to clipboard
class GaussianRandom(random: Random)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
const val maxRecursionBound: Int = 5

Maximum recursion bound for '+' and '*' replacements in .randomRegexpishString.

Link copied to clipboard

Operators for .randomRegexpishString.

Link copied to clipboard

A comparator that compares UTF-16 strings / char sequences according to Unicode code point order. This can be used to verify BytesRef order.

Functions

Link copied to clipboard
fun addIndexesSlowly(writer: IndexWriter, vararg readers: DirectoryReader)
Link copied to clipboard

Return a Codec that can read any of the default codecs and formats, but always writes in the specified format.

Link copied to clipboard

Return a Codec that can read any of the default codecs and formats, but always writes in the specified format.

Link copied to clipboard

Return a Codec that can read any of the default codecs and formats, but always writes in the specified format.

Link copied to clipboard

Checks some basic behaviour of an AttributeImpl

Link copied to clipboard
fun assertConsistent(expected: TopDocs, actual: TopDocs)

Assert that the given TopDocs have the same top docs and consistent hit counts.

Link copied to clipboard

For debugging: tries to include br.utf8ToString(), but if that fails (because it's not valid utf8, which is fine!), just use ordinary toString.

Link copied to clipboard
Link copied to clipboard

This runs the CheckIndex tool on the index in. If any issues are hit, a RuntimeException is thrown; else, true is returned.


fun checkIndex(dir: Directory, level: Int, failFast: Boolean, concurrent: Boolean, output: ByteArrayOutputStream?): CheckIndex.Status

If failFast is true, then throw the first exception when index corruption is hit, instead of moving on to other fields/segments to look for any other corruption.

Link copied to clipboard
fun <T> checkIterator(iterator: MutableIterator<T?>)
fun <T> checkIterator(iterator: MutableIterator<T>, expectedSize: Long, allowNull: Boolean)

Checks that the provided iterator is well-formed.

Link copied to clipboard

This runs the CheckIndex tool on the Reader. If any issues are hit, a RuntimeException is thrown

fun checkReader(reader: LeafReader, level: Int)
Link copied to clipboard

Checks that the provided collection is read-only.

Link copied to clipboard
fun docs(random: Random, termsEnum: TermsEnum, reuse: PostingsEnum?, flags: Int): PostingsEnum
fun docs(random: Random, r: IndexReader, field: String, term: BytesRef, reuse: PostingsEnum?, flags: Int): PostingsEnum?
Link copied to clipboard
fun doubleUlpEquals(x: Double, y: Double, maxUlps: Int): Boolean

Returns true if the arguments are equal or within the range of allowed error (inclusive). Returns false if either of the arguments is NaN.

Link copied to clipboard
fun floatUlpEquals(x: Float, y: Float, maxUlps: Short): Boolean

Returns true if the arguments are equal or within the range of allowed error (inclusive). Returns false if either of the arguments is NaN.

Link copied to clipboard

Returns the actual default codec (e.g. LuceneMNCodec) for this version of Lucene. This may be different from Codec.getDefault because that is randomized.

Link copied to clipboard

Returns the actual default docvalues format (e.g. LuceneMNDocValuesFormat) for this version of Lucene.

Link copied to clipboard

Returns the actual default vector format (e.g. LuceneMNKnnVectorsFormat) for this version of Lucene.

Link copied to clipboard
fun getDefaultPostingsFormat(minItemsPerBlock: Int, maxItemsPerBlock: Int): PostingsFormat

Returns the actual default postings format (e.g. LuceneMNPostingsFormat) for this version of Lucene.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns a random postings format that supports term ordinals

Link copied to clipboard
fun nextBigInteger(random: Random, maxBytes: Int): BigInteger

Returns a randomish big integer with 1 .. maxBytes storage.

Link copied to clipboard
fun nextInt(r: Random, start: Int, end: Int): Int

start and end are BOTH inclusive

Link copied to clipboard
fun nextLong(r: Random, start: Long, end: Long): Long

start and end are BOTH inclusive

Link copied to clipboard

Returns a copy of the source directory, with file contents stored in RAM.

Link copied to clipboard
fun random(): Random

Returns a shared random instance for test code, similar to Lucene's random(). This is useful for test classes that want a consistent random source.

Link copied to clipboard
fun randomAnalysisString(random: Random, maxLength: Int, simple: Boolean): String

Returns a valid (compiling) Pattern instance with random stuff inside. Be careful when applying random patterns to longer strings as certain types of patterns may explode into exponential times in backtracking implementations (such as Java's).

Link copied to clipboard

Returns a random binary term.

Returns a random binary with a given length

Link copied to clipboard

Returns random string, with a given UTF-8 byte length

Link copied to clipboard
fun randomFixedLengthUnicodeString(random: Random, chars: CharArray, offset: Int, length: Int)

Fills provided char[] with valid random unicode code unit sequence.

Link copied to clipboard
fun randomHtmlishString(random: Random, numElements: Int): String
Link copied to clipboard

Randomly upcases, downcases, or leaves intact each code point in the given string

Link copied to clipboard

Returns random string of length between 0-20 codepoints, all codepoints within the same unicode block.

Returns random string of length up to maxLength codepoints , all codepoints within the same unicode block.

fun randomRealisticUnicodeString(r: Random, minLength: Int, maxLength: Int): String

Returns random string of length between min and max codepoints, all codepoints within the same unicode block.

Link copied to clipboard
fun randomRegexpishString(r: Random, maxLength: Int): String

Returns a String that's "regexpish" (contains lots of operators typically found in regular expressions) If you call this enough times, you might get a valid regex!

Link copied to clipboard
fun randomSimpleString(r: Random, maxLength: Int): String
fun randomSimpleString(r: Random, minLength: Int, maxLength: Int): String
Link copied to clipboard
fun randomSimpleStringRange(r: Random, minChar: Char, maxChar: Char, maxLength: Int): String
Link copied to clipboard
fun randomSubString(random: Random, wordLength: Int, simple: Boolean): String
Link copied to clipboard

Returns random string, including full unicode range.

fun randomUnicodeString(r: Random, maxLength: Int): String

Returns a random string up to a certain length.

Link copied to clipboard
fun rarely(random: Random): Boolean

Returns true rarely (about 1 in 20 times)

Link copied to clipboard

just tries to configure things to keep the open file count lowish

Link copied to clipboard

Shutdown ExecutorService and wait for its.

Link copied to clipboard