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.

Constructors

Link copied to clipboard
constructor(r: Random, dir: Directory)

create a RandomIndexWriter with a random config: Uses MockAnalyzer

constructor(r: Random, dir: Directory, a: Analyzer)

create a RandomIndexWriter with a random config

constructor(r: Random, dir: Directory, c: IndexWriterConfig)

create a RandomIndexWriter with the provided config

constructor(r: Random, dir: Directory, c: IndexWriterConfig, useSoftDeletes: Boolean)

create a RandomIndexWriter with the provided config

Types

Link copied to clipboard
object Companion
Link copied to clipboard
interface TestPoint

Simple interface that is executed for each TP InfoStream component message. See also RandomIndexWriter.mockIndexWriter

Properties

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

Functions

Link copied to clipboard

Adds a Document.

Link copied to clipboard
Link copied to clipboard
fun addIndexes(vararg readers: CodecReader): Long
fun addIndexes(vararg dirs: Directory): Long
Link copied to clipboard
open override fun close()

Close this writer.

Link copied to clipboard
fun commit(flushConcurrently: Boolean = r.nextInt(10) == 0): Long
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun flush()

Writes all in-memory segments to the Directory.

Link copied to clipboard
fun forceMerge(maxSegmentCount: Int)

Forces a forceMerge.

Link copied to clipboard
Link copied to clipboard
fun getReader(applyDeletions: Boolean, writeAllDeletes: Boolean): DirectoryReader
Link copied to clipboard
Link copied to clipboard
fun updateBinaryDocValue(term: Term, field: String, value: BytesRef): Long
Link copied to clipboard

Updates a document.

Link copied to clipboard
Link copied to clipboard
fun updateDocValues(term: Term, vararg updates: Field): Long
Link copied to clipboard
fun updateNumericDocValue(term: Term, field: String, value: Long): Long