Class BinaryPoint

    • Constructor Detail

      • BinaryPoint

        public BinaryPoint​(String name,
                           byte[]... point)
        General purpose API: creates a new BinaryPoint, indexing the provided N-dimensional binary point.
        Parameters:
        name - field name
        point - byte[][] value
        Throws:
        IllegalArgumentException - if the field name or value is null.
    • Method Detail

      • newExactQuery

        public static Query newExactQuery​(String field,
                                          byte[] value)
        Create a query for matching an exact binary value.

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

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

        public static Query newRangeQuery​(String field,
                                          byte[] lowerValue,
                                          byte[] upperValue)
        Create a range query for binary values.

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

        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:
        IllegalArgumentException - if field is null, if lowerValue is null, or if upperValue is null
      • newRangeQuery

        public static Query newRangeQuery​(String field,
                                          byte[][] lowerValue,
                                          byte[][] upperValue)
        Create a range query for n-dimensional binary values.
        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:
        IllegalArgumentException - if field is null, if lowerValue is null, if upperValue is null, or if lowerValue.length != upperValue.length
      • newSetQuery

        public static Query newSetQuery​(String field,
                                        byte[]... 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