LongRange

class LongRange(name: String, min: LongArray, max: LongArray) : Field

An indexed Long Range field.

This field indexes dimensional ranges defined as min/max pairs. It supports up to a maximum of 4 dimensions (indexed as 8 numeric values). With 1 dimension representing a single long range, 2 dimensions representing a bounding box, 3 dimensions a bounding cube, and 4 dimensions a tesseract.

Multiple values for the same field in one document is supported, and open ended ranges can be defined using Long.MIN_VALUE and Long.MAX_VALUE.

This field defines the following static factory methods for common search operations over long ranges:

  • .newIntersectsQuery matches ranges that intersect the defined search range.

  • .newWithinQuery matches ranges that are within the defined search range.

  • .newContainsQuery matches ranges that contain the defined search range.

Constructors

Link copied to clipboard
constructor(name: String, min: LongArray, max: LongArray)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val charSequenceValue: CharSequence?

Functions

Link copied to clipboard
open override fun binaryValue(): BytesRef?

Non-null if this field has a binary value

Link copied to clipboard
open override fun fieldType(): IndexableFieldType

Returns the FieldType for this field.

Link copied to clipboard
fun getMax(dimension: Int): Long

Get the max value for the given dimension

Link copied to clipboard
fun getMin(dimension: Int): Long

Get the min value for the given dimension

Link copied to clipboard
open override fun invertableType(): InvertableType

Describes how this field should be inverted. This must return a non-null value if the field indexes terms and postings.

Link copied to clipboard
open override fun name(): String

Field name

Link copied to clipboard
open override fun numericValue(): Number?

Non-null if this field has a numeric value

Link copied to clipboard
open override fun readerValue(): Reader?

The value of the field as a Reader, or null. If null, the String value or binary value is used. Exactly one of stringValue(), readerValue(), and binaryValue() must be set.

Link copied to clipboard
open fun setBytesValue(value: BytesRef)

Expert: change the value of this field. See .setStringValue.

Link copied to clipboard
fun setByteValue(value: Byte)

Expert: change the value of this field. See .setStringValue.

Link copied to clipboard
open fun setDoubleValue(value: Double)

Expert: change the value of this field. See .setStringValue.

Link copied to clipboard
open fun setFloatValue(value: Float)

Expert: change the value of this field. See .setStringValue.

Link copied to clipboard
open fun setIntValue(value: Int)

Expert: change the value of this field. See .setStringValue.

Link copied to clipboard
open fun setLongValue(value: Long)

Expert: change the value of this field. See .setStringValue.

Link copied to clipboard

Changes the values of the field.

Link copied to clipboard

Expert: change the value of this field. See .setStringValue.

Link copied to clipboard
fun setShortValue(value: Short)

Expert: change the value of this field. See .setStringValue.

Link copied to clipboard
open fun setStringValue(value: String)

Expert: change the value of this field. This can be used during indexing to re-use a single Field instance to improve indexing speed by avoiding GC cost of new'ing and reclaiming Field instances. Typically a single Document instance is re-used as well. This helps most on small documents.

Link copied to clipboard
fun setTokenStream(tokenStream: TokenStream)

Expert: sets the token stream to be used for indexing.

Link copied to clipboard
open override fun storedValue(): StoredValue?

Stored value. This method is called to populate stored fields and must return a non-null value if the field stored.

Link copied to clipboard
open override fun stringValue(): String?

The value of the field as a String, or null. If null, the Reader value or binary value is used. Exactly one of stringValue(), readerValue(), and binaryValue() must be set.

Link copied to clipboard
open override fun tokenStream(analyzer: Analyzer, reuse: TokenStream?): TokenStream?

Creates the TokenStream used for indexing this field. If appropriate, implementations should use the given Analyzer to create the TokenStreams.

Link copied to clipboard

The TokenStream for this field to be used when indexing, or null. If null, the Reader value or String value is analyzed to produce the indexed tokens.

Link copied to clipboard
open override fun toString(): String

Returns the String representation for the range at the given dimension