Package org.apache.lucene.document
Class BinaryRange
org.apache.lucene.document.Field
org.apache.lucene.document.BinaryRange
- All Implemented Interfaces:
org.apache.lucene.index.IndexableField
public final class BinaryRange
extends org.apache.lucene.document.Field
A range field for binary encoded ranges
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.document.Field
org.apache.lucene.document.Field.Store
-
Field Summary
Modifier and TypeFieldDescriptionstatic int
The number of bytes per dimension, useInetAddressPoint.BYTES
as max, because that is maximum we need to supportFields inherited from class org.apache.lucene.document.Field
fieldsData, name, tokenStream, type
-
Constructor Summary
ConstructorDescriptionname, byte[] encodedRange)
Create a new BinaryRange from a provided encoded binary range -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.lucene.search.Query
field, byte[] encodedRange)
Create a query for matching indexed ip ranges thatINTERSECT
the defined range.Methods inherited from class org.apache.lucene.document.Field
binaryValue, fieldType, getCharSequenceValue, name, numericValue, readerValue, setBytesValue, setBytesValue, setByteValue, setDoubleValue, setFloatValue, setIntValue, setLongValue, setReaderValue, setShortValue, setStringValue, setTokenStream, stringValue, tokenStream, tokenStreamValue, toString
Methods inherited from class java.lang.
, , , , , , , , ,
-
Field Details
-
BYTES
public static final int BYTESThe number of bytes per dimension, useInetAddressPoint.BYTES
as max, because that is maximum we need to support- See Also:
- Constant Field Values
-
-
Constructor Details
-
BinaryRange
public BinaryRange( name, byte[] encodedRange)Create a new BinaryRange from a provided encoded binary range- Parameters:
name
- field name. must not be null.encodedRange
- Encoded range
-
-
Method Details
-
newIntersectsQuery
public static org.apache.lucene.search.Query newIntersectsQuery( field, byte[] encodedRange)Create a query for matching indexed ip ranges thatINTERSECT
the defined range.- Parameters:
field
- field name. must not be null.encodedRange
- Encoded range- Returns:
- query for matching intersecting encoded ranges (overlap, within, crosses, or contains)
- Throws:
- if
field
is null,min
ormax
is invalid
-