Class 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

      Fields 
      Modifier and Type Field Description
      static int BYTES
      The number of bytes per dimension, use InetAddressPoint.BYTES as max, because that is maximum we need to support
      • Fields inherited from class org.apache.lucene.document.Field

        fieldsData, name, tokenStream, type
    • 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 that INTERSECT 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.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • BYTES

        public static final int BYTES
        The number of bytes per dimension, use InetAddressPoint.BYTES as max, because that is maximum we need to support
        See Also:
        Constant Field Values
    • Constructor Detail

      • 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 Detail

      • newIntersectsQuery

        public static org.apache.lucene.search.Query newIntersectsQuery​(java.lang.String field,
                                                                        byte[] encodedRange)
        Create a query for matching indexed ip ranges that INTERSECT 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 - if field is null, min or max is invalid