TermsHashPerField

abstract class TermsHashPerField(streamCount: Int, intPool: IntBlockPool, val bytePool: ByteBlockPool, termBytePool: ByteBlockPool, bytesUsed: Counter, val nextPerField: TermsHashPerField?, val fieldName: String, indexOptions: IndexOptions) : Comparable<TermsHashPerField>

This class stores streams of information per term without knowing the size of the stream ahead of time. Each stream typically encodes one level of information like term frequency per document or term proximity. Internally this class allocates a linked list of slices that can be read by a ByteSliceReader for each term. Terms are first deduplicated in a BytesRefHash once this is done internal data-structures point to the current offset of each stream that can be written to.

Inheritors

Constructors

Link copied to clipboard
constructor(streamCount: Int, intPool: IntBlockPool, bytePool: ByteBlockPool, termBytePool: ByteBlockPool, bytesUsed: Counter, nextPerField: TermsHashPerField?, fieldName: String, indexOptions: IndexOptions)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
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
fun add(termBytes: BytesRef, docID: Int)

Called once per inverted token. This is the primary entry point (for first TermsHash); postings use this API.

Link copied to clipboard
abstract fun addTerm(termID: Int, docID: Int)

Called when a previously seen term is seen again.

Link copied to clipboard
open operator override fun compareTo(other: TermsHashPerField): Int
Link copied to clipboard

Creates a new postings array of the specified size.

Link copied to clipboard
open fun finish()

Finish adding all instances of this field to the current document.

Link copied to clipboard

Returns the sorted term IDs. .sortTerms must be called before

Link copied to clipboard
fun initReader(reader: ByteSliceReader, termID: Int, stream: Int)
Link copied to clipboard
abstract fun newPostingsArray()

Called when the postings array is initialized or resized.

Link copied to clipboard
abstract fun newTerm(termID: Int, docID: Int)

Called when a term is seen for the first time.

Link copied to clipboard
Link copied to clipboard
fun reset()
Link copied to clipboard
fun sortTerms()

Collapse the hash table and sort in-place; also sets this.sortedTermIDs to the results This method must not be called twice unless .reset or .reinitHash was called.

Link copied to clipboard
open fun start(field: IndexableField?, first: Boolean): Boolean

Start adding a new field instance; first is true if this is the first time this field name was seen in the document.

Link copied to clipboard
fun writeByte(stream: Int, b: Byte)
Link copied to clipboard
fun writeBytes(stream: Int, b: ByteArray, offset: Int, len: Int)
Link copied to clipboard
fun writeVInt(stream: Int, i: Int)