Package org.apache.lucene.document
Class BinaryRange
java.lang.Object
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
-
Field Summary
Fields Modifier and Type Field Description static int
BYTES
The number of bytes per dimension, useInetAddressPoint.BYTES
as max, because that is maximum we need to support -
Constructor Summary
Constructors Constructor Description BinaryRange(java.lang.String name, byte[] encodedRange)
Create a new BinaryRange from a provided encoded binary range -
Method Summary
Modifier and Type Method Description static org.apache.lucene.search.Query
newIntersectsQuery(java.lang.String 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
-
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(java.lang.String 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(java.lang.String 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:
java.lang.IllegalArgumentException
- iffield
is null,min
ormax
is invalid
-