jruby/docs BETA
Navigation
org.apache.lucene.document 56
C BinaryDocValuesField
C BinaryPoint
C BinaryRangeDocValues
C DateTools
C Document
C DocumentStoredFieldVisitor
C DoubleDocValuesField
C DoubleField
C DoublePoint
C DoubleRange
C DoubleRangeDocValuesField
C FeatureField
C Field
C FieldType
C FloatDocValuesField
C FloatField
C FloatPoint
C FloatRange
C FloatRangeDocValuesField
C InetAddressPoint
C InetAddressRange
C IntField
C IntPoint
C IntRange
C IntRangeDocValuesField
E InvertableType
C KeywordField
C KnnByteVectorField
C KnnFloatVectorField
C LatLonDocValuesField
C LatLonPoint
C LatLonShape
C LatLonShapeDocValues
C LatLonShapeDocValuesField
C LateInteractionField
C LongField
C LongPoint
C LongRange
C LongRangeDocValuesField
C NumericDocValuesField
C RangeFieldQuery
C ShapeDocValuesField
C ShapeField
C SortedDocValuesField
C SortedNumericDocValuesField
C SortedSetDocValuesField
C StoredField
C StoredValue
C StringField
C TextField
C XYDocValuesField
C XYDocValuesPointInGeometryQuery
C XYPointField
C XYShape
C XYShapeDocValues
C XYShapeDocValuesField
FloatRange — members 10+
F BYTES() int
C new(name, min, max)
M get_max(dimension) float
M get_min(dimension) float
M new_contains_query(field, min, max) Query
M new_crosses_query(field, min, max) Query
M new_intersects_query(field, min, max) Query
M new_within_query(field, min, max) Query
C set_range_values(min, max)
M to_string() String
from Field
M binary_value() BytesRef
C byte_value=(value)
C bytes_value=(value)
C bytes_value=(value)
M char_sequence_value() CharSequence
C double_value=(value)
M field_type() IndexableFieldType
C float_value=(value)
C int_value=(value)
M invertable_type() InvertableType
C long_value=(value)
M name() String
M numeric_value() Number
M reader_value() Reader
C reader_value=(value)
C short_value=(value)
M stored_value() StoredValue
M string_value() String
C string_value=(value)
M token_stream(analyzer, reuse) TokenStream
C token_stream=(token_stream)
M token_stream_value() TokenStream

org.apache.lucene.document.FloatRange

class extends Field 10 members

An indexed Float 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 float 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 Float.NEGATIVE_INFINITY and Float.POSITIVE_INFINITY.

This field defines the following static factory methods for common search operations over float 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.

Constants

constanttypenote
BYTES int stores float values so number of bytes is 4

Constructors

new

new ( String name, float[] min, float[] max )
Java: <init>(String name, float[] min, float[] max)

Create a new FloatRange type, from min/max parallel arrays

nametypedescription
nameStringfield name. must not be null.
minfloat[]range min values; each entry is the min value for the dimension
maxfloat[]range max values; each entry is the max value for the dimension

Class Methods

new_contains_query

Query new_contains_query ( String field, float[] min, float[] max )
Java: newContainsQuery(String field, float[] min, float[] max)

Create a query for matching indexed float ranges that contain the defined range.

nametypedescription
fieldStringfield name. must not be null.
minfloat[]array of min values. (accepts Float.NEGATIVE_INFINITY)
maxfloat[]array of max values. (accepts Float.POSITIVE_INFINITY)

Returns: query for matching ranges that contain the defined range

Throws

IllegalArgumentException if field is null, min or max is invalid

new_crosses_query

Query new_crosses_query ( String field, float[] min, float[] max )
Java: newCrossesQuery(String field, float[] min, float[] max)

Create a query for matching indexed ranges that cross the defined range. A CROSSES is defined as any set of ranges that are not disjoint and not wholly contained by the query. Effectively, its the complement of union(WITHIN, DISJOINT).

nametypedescription
fieldStringfield name. must not be null.
minfloat[]array of min values. (accepts Float.NEGATIVE_INFINITY)
maxfloat[]array of max values. (accepts Float.POSITIVE_INFINITY)

Returns: query for matching ranges within the defined range

Throws

IllegalArgumentException if field is null, min or max is invalid

new_intersects_query

Query new_intersects_query ( String field, float[] min, float[] max )
Java: newIntersectsQuery(String field, float[] min, float[] max)

Create a query for matching indexed ranges that intersect the defined range.

nametypedescription
fieldStringfield name. must not be null.
minfloat[]array of min values. (accepts Float.NEGATIVE_INFINITY)
maxfloat[]array of max values. (accepts Float.MAX_VALUE)

Returns: query for matching intersecting ranges (overlap, within, or contains)

Throws

IllegalArgumentException if field is null, min or max is invalid

new_within_query

Query new_within_query ( String field, float[] min, float[] max )
Java: newWithinQuery(String field, float[] min, float[] max)

Create a query for matching indexed ranges that are within the defined range.

nametypedescription
fieldStringfield name. must not be null.
minfloat[]array of min values. (accepts Float.NEGATIVE_INFINITY)
maxfloat[]array of max values. (accepts Float.POSITIVE_INFINITY)

Returns: query for matching ranges within the defined range

Throws

IllegalArgumentException if field is null, min or max is invalid

Instance Methods

get_max

float get_max ( int dimension )
Java: getMax(int dimension)

Get the max value for the given dimension

nametypedescription
dimensionintthe dimension, always positive

Returns: the decoded max value

get_min

float get_min ( int dimension )
Java: getMin(int dimension)

Get the min value for the given dimension

nametypedescription
dimensionintthe dimension, always positive

Returns: the decoded min value

set_range_values

set_range_values ( float[] min, float[] max )
Java: setRangeValues(float[] min, float[] max)

Changes the values of the field.

nametypedescription
minfloat[]array of min values. (accepts Float.NEGATIVE_INFINITY)
maxfloat[]array of max values. (accepts Float.POSITIVE_INFINITY)

Throws

IllegalArgumentException if min or max is invalid

to_string

String to_string ( )
Java: toString()

Inherited

from Field

binary_value

BytesRef binary_value ( )
Java: binaryValue()

byte_value=

byte_value= ( byte value )
Java: setByteValue(byte value) · also: set_byte_value

Expert: change the value of this field. See #setStringValue(String).

bytes_value=

bytes_value= ( byte[] value )
Java: setBytesValue(byte[] value) · also: set_bytes_value

Expert: change the value of this field. See #setStringValue(String).

bytes_value=

bytes_value= ( BytesRef value )
Java: setBytesValue(org.apache.lucene.util.BytesRef value) · also: set_bytes_value

Expert: change the value of this field. See #setStringValue(String).

NOTE: the provided BytesRef is not copied so be sure not to change it until you're done with this field.

char_sequence_value

CharSequence char_sequence_value ( )
Java: getCharSequenceValue() · also: get_char_sequence_value

double_value=

double_value= ( double value )
Java: setDoubleValue(double value) · also: set_double_value

Expert: change the value of this field. See #setStringValue(String).

field_type

IndexableFieldType field_type ( )
Java: fieldType()

Returns the FieldType for this field.

float_value=

float_value= ( float value )
Java: setFloatValue(float value) · also: set_float_value

Expert: change the value of this field. See #setStringValue(String).

int_value=

int_value= ( int value )
Java: setIntValue(int value) · also: set_int_value

Expert: change the value of this field. See #setStringValue(String).

invertable_type

InvertableType invertable_type ( )
Java: invertableType()

long_value=

long_value= ( long value )
Java: setLongValue(long value) · also: set_long_value

Expert: change the value of this field. See #setStringValue(String).

name

String name ( )
Java: name()

numeric_value

Number numeric_value ( )
Java: numericValue()

reader_value

Reader reader_value ( )
Java: readerValue()

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.

reader_value=

reader_value= ( Reader value )
Java: setReaderValue(java.io.Reader value) · also: set_reader_value

Expert: change the value of this field. See #setStringValue(String).

short_value=

short_value= ( short value )
Java: setShortValue(short value) · also: set_short_value

Expert: change the value of this field. See #setStringValue(String).

stored_value

StoredValue stored_value ( )
Java: storedValue()

string_value

String string_value ( )
Java: stringValue()

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.

string_value=

string_value= ( String value )
Java: setStringValue(String value) · also: set_string_value

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.

Each Field instance should only be used once within a single Document instance. See ImproveIndexingSpeed for details.

token_stream

TokenStream token_stream ( Analyzer analyzer, TokenStream reuse )
Java: tokenStream(org.apache.lucene.analysis.Analyzer analyzer, org.apache.lucene.analysis.TokenStream reuse)

token_stream=

token_stream= ( TokenStream token_stream )
Java: setTokenStream(org.apache.lucene.analysis.TokenStream tokenStream) · also: set_token_stream

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

token_stream_value

TokenStream token_stream_value ( )
Java: tokenStreamValue()

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.

this work for additional information regarding copyright ownership.