Class BigIntegerPoint

    • Field Detail

      • BYTES

        public static final int BYTES
        The number of bytes per dimension: 128 bits.
        See Also:
        Constant Field Values
      • MIN_VALUE

        public static final java.math.BigInteger MIN_VALUE
        A constant holding the minimum value a BigIntegerPoint can have, -2127.
      • MAX_VALUE

        public static final java.math.BigInteger MAX_VALUE
        A constant holding the maximum value a BigIntegerPoint can have, 2127-1.
    • Constructor Detail

      • BigIntegerPoint

        public BigIntegerPoint​(java.lang.String name,
                               java.math.BigInteger... point)
        Creates a new BigIntegerPoint, indexing the provided N-dimensional big integer point.
        Parameters:
        name - field name
        point - BigInteger[] value
        Throws:
        java.lang.IllegalArgumentException - if the field name or value is null.
    • Method Detail

      • getType

        private static FieldType getType​(int numDims)
      • setBigIntegerValues

        public void setBigIntegerValues​(java.math.BigInteger... point)
        Change the values of this field
      • setBytesValue

        public void setBytesValue​(BytesRef bytes)
        Description copied from class: Field
        Expert: change the value of this field. See Field.setStringValue(String).

        NOTE: the provided BytesRef is not copied so be sure not to change it until you're done with this field.

        Overrides:
        setBytesValue in class Field
      • pack

        private static BytesRef pack​(java.math.BigInteger... point)
      • toString

        public java.lang.String toString()
        Description copied from class: Field
        Prints a Field for human consumption.
        Overrides:
        toString in class Field
      • encodeDimension

        public static void encodeDimension​(java.math.BigInteger value,
                                           byte[] dest,
                                           int offset)
        Encode single BigInteger dimension
      • decodeDimension

        public static java.math.BigInteger decodeDimension​(byte[] value,
                                                           int offset)
        Decode single BigInteger dimension
      • newExactQuery

        public static Query newExactQuery​(java.lang.String field,
                                          java.math.BigInteger value)
        Create a query for matching an exact big integer value.

        This is for simple one-dimension points, for multidimensional points use newRangeQuery(String, BigInteger[], BigInteger[]) instead.

        Parameters:
        field - field name. must not be null.
        value - exact value. must not be null.
        Returns:
        a query matching documents with this exact value
        Throws:
        java.lang.IllegalArgumentException - if field is null or value is null.
      • newRangeQuery

        public static Query newRangeQuery​(java.lang.String field,
                                          java.math.BigInteger lowerValue,
                                          java.math.BigInteger upperValue)
        Create a range query for big integer values.

        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)

        Parameters:
        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.
        Returns:
        a query matching documents within this range.
        Throws:
        java.lang.IllegalArgumentException - if field is null, lowerValue is null, or upperValue is null.
      • newRangeQuery

        public static Query newRangeQuery​(java.lang.String field,
                                          java.math.BigInteger[] lowerValue,
                                          java.math.BigInteger[] upperValue)
        Create a range query for n-dimensional big integer values.

        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)

        Parameters:
        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.
        Returns:
        a query matching documents within this range.
        Throws:
        java.lang.IllegalArgumentException - if field is null, if lowerValue is null, if upperValue is null, or if lowerValue.length != upperValue.length
      • newSetQuery

        public static Query newSetQuery​(java.lang.String field,
                                        java.math.BigInteger... values)
        Create a query matching any of the specified 1D values. This is the points equivalent of TermsQuery.
        Parameters:
        field - field name. must not be null.
        values - all values to match