public class BigIntegerPoint extends Field
BigInteger
field.
Finding all documents within an N-dimensional shape or range at search time is efficient. Multiple values for the same field in one document is allowed.
This field defines static factory methods for creating common queries:
newExactQuery(String, BigInteger)
for matching an exact 1D point.
newSetQuery(String, BigInteger...)
for matching a set of 1D values.
newRangeQuery(String, BigInteger, BigInteger)
for matching a 1D range.
newRangeQuery(String, BigInteger[], BigInteger[])
for matching points/ranges in n-dimensional space.
PointValues
Field.Store
Modifier and Type | Field and Description |
---|---|
static int |
BYTES
The number of bytes per dimension: 128 bits.
|
static BigInteger |
MAX_VALUE
A constant holding the maximum value a BigIntegerPoint can have, 2127-1.
|
static BigInteger |
MIN_VALUE
A constant holding the minimum value a BigIntegerPoint can have, -2127.
|
fieldsData, name, tokenStream, type
Constructor and Description |
---|
BigIntegerPoint(String name,
BigInteger... point)
Creates a new BigIntegerPoint, indexing the
provided N-dimensional big integer point.
|
Modifier and Type | Method and Description |
---|---|
static BigInteger |
decodeDimension(byte[] value,
int offset)
Decode single BigInteger dimension
|
static void |
encodeDimension(BigInteger value,
byte[] dest,
int offset)
Encode single BigInteger dimension
|
static Query |
newExactQuery(String field,
BigInteger value)
Create a query for matching an exact big integer value.
|
static Query |
newRangeQuery(String field,
BigInteger[] lowerValue,
BigInteger[] upperValue)
Create a range query for n-dimensional big integer values.
|
static Query |
newRangeQuery(String field,
BigInteger lowerValue,
BigInteger upperValue)
Create a range query for big integer values.
|
static Query |
newSetQuery(String field,
BigInteger... values)
Create a query matching any of the specified 1D values.
|
Number |
numericValue() |
void |
setBigIntegerValues(BigInteger... point)
Change the values of this field
|
void |
setBytesValue(BytesRef bytes) |
String |
toString() |
binaryValue, fieldType, getCharSequenceValue, name, readerValue, setBytesValue, setByteValue, setDoubleValue, setFloatValue, setIntValue, setLongValue, setReaderValue, setShortValue, setStringValue, setTokenStream, stringValue, tokenStream, tokenStreamValue
public static final int BYTES
public static final BigInteger MIN_VALUE
public static final BigInteger MAX_VALUE
public BigIntegerPoint(String name, BigInteger... point)
name
- field namepoint
- BigInteger[] valueIllegalArgumentException
- if the field name or value is null.public void setBigIntegerValues(BigInteger... point)
public void setBytesValue(BytesRef bytes)
setBytesValue
in class Field
public Number numericValue()
numericValue
in interface IndexableField
numericValue
in class Field
public static void encodeDimension(BigInteger value, byte[] dest, int offset)
public static BigInteger decodeDimension(byte[] value, int offset)
public static Query newExactQuery(String field, BigInteger value)
This is for simple one-dimension points, for multidimensional points use
newRangeQuery(String, BigInteger[], BigInteger[])
instead.
field
- field name. must not be null
.value
- exact value. must not be null
.IllegalArgumentException
- if field
is null or value
is null.public static Query newRangeQuery(String field, BigInteger lowerValue, BigInteger upperValue)
This is for simple one-dimension ranges, for multidimensional ranges use
newRangeQuery(String, BigInteger[], BigInteger[])
instead.
You can have half-open ranges (which are in fact </≤ or >/≥ queries)
by setting lowerValue = BigIntegerPoint.MIN_VALUE
or upperValue = BigIntegerPoint.MAX_VALUE
.
Ranges are inclusive. For exclusive ranges, pass lowerValue.add(BigInteger.ONE)
or upperValue.subtract(BigInteger.ONE)
field
- field name. must not be null
.lowerValue
- lower portion of the range (inclusive). must not be null
.upperValue
- upper portion of the range (inclusive). must not be null
.IllegalArgumentException
- if field
is null, lowerValue
is null, or upperValue
is null.public static Query newRangeQuery(String field, BigInteger[] lowerValue, BigInteger[] upperValue)
You can have half-open ranges (which are in fact </≤ or >/≥ queries)
by setting lowerValue[i] = BigIntegerPoint.MIN_VALUE
or upperValue[i] = BigIntegerPoint.MAX_VALUE
.
Ranges are inclusive. For exclusive ranges, pass lowerValue[i].add(BigInteger.ONE)
or upperValue[i].subtract(BigInteger.ONE)
field
- field name. must not be null
.lowerValue
- lower portion of the range (inclusive). must not be null
.upperValue
- upper portion of the range (inclusive). must not be null
.IllegalArgumentException
- if field
is null, if lowerValue
is null, if upperValue
is null,
or if lowerValue.length != upperValue.length
public static Query newSetQuery(String field, BigInteger... values)
TermsQuery
.field
- field name. must not be null
.values
- all values to matchCopyright © 2000-2024 Apache Software Foundation. All Rights Reserved.