public final class BinaryPoint extends Field
StoredField
instance.
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, byte[])
for matching an exact 1D point.
newSetQuery(String, byte[]...)
for matching a set of 1D values.
newRangeQuery(String, byte[], byte[])
for matching a 1D range.
newRangeQuery(String, byte[][], byte[][])
for matching points/ranges in n-dimensional space.
PointValues
Field.Store
fieldsData, name, tokenStream, type
Constructor and Description |
---|
BinaryPoint(String name,
byte[]... point)
General purpose API: creates a new BinaryPoint, indexing the
provided N-dimensional binary point.
|
BinaryPoint(String name,
byte[] packedPoint,
IndexableFieldType type)
Expert API
|
Modifier and Type | Method and Description |
---|---|
static Query |
newExactQuery(String field,
byte[] value)
Create a query for matching an exact binary value.
|
static Query |
newRangeQuery(String field,
byte[][] lowerValue,
byte[][] upperValue)
Create a range query for n-dimensional binary values.
|
static Query |
newRangeQuery(String field,
byte[] lowerValue,
byte[] upperValue)
Create a range query for binary values.
|
static Query |
newSetQuery(String field,
byte[]... values)
Create a query matching any of the specified 1D values.
|
binaryValue, fieldType, getCharSequenceValue, name, numericValue, readerValue, setBytesValue, setBytesValue, setByteValue, setDoubleValue, setFloatValue, setIntValue, setLongValue, setReaderValue, setShortValue, setStringValue, setTokenStream, stringValue, tokenStream, tokenStreamValue, toString
public BinaryPoint(String name, byte[]... point)
name
- field namepoint
- byte[][] valueIllegalArgumentException
- if the field name or value is null.public BinaryPoint(String name, byte[] packedPoint, IndexableFieldType type)
public static Query newExactQuery(String field, byte[] value)
This is for simple one-dimension points, for multidimensional points use
newRangeQuery(String, byte[][], byte[][])
instead.
field
- field name. must not be null
.value
- binary valueIllegalArgumentException
- if field
is null or value
is nullpublic static Query newRangeQuery(String field, byte[] lowerValue, byte[] upperValue)
This is for simple one-dimension ranges, for multidimensional ranges use
newRangeQuery(String, byte[][], byte[][])
instead.
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,
or if upperValue
is nullpublic static Query newRangeQuery(String field, byte[][] lowerValue, byte[][] upperValue)
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
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.