Example usage for org.apache.lucene.document FloatPoint nextDown

List of usage examples for org.apache.lucene.document FloatPoint nextDown

Introduction

In this page you can find the example usage for org.apache.lucene.document FloatPoint nextDown.

Prototype

public static float nextDown(float f) 

Source Link

Document

Return the greatest float that compares less than f consistently with Float#compare .

Usage

From source file:org.apache.solr.schema.FloatPointField.java

License:Apache License

@Override
public Query getPointRangeQuery(QParser parser, SchemaField field, String min, String max, boolean minInclusive,
        boolean maxInclusive) {
    float actualMin, actualMax;
    if (min == null) {
        actualMin = Float.NEGATIVE_INFINITY;
    } else {//from   w  ww  . j a va 2  s.  c om
        actualMin = Float.parseFloat(min);
        if (!minInclusive) {
            actualMin = FloatPoint.nextUp(actualMin);
        }
    }
    if (max == null) {
        actualMax = Float.POSITIVE_INFINITY;
    } else {
        actualMax = Float.parseFloat(max);
        if (!maxInclusive) {
            actualMax = FloatPoint.nextDown(actualMax);
        }
    }
    return FloatPoint.newRangeQuery(field.getName(), actualMin, actualMax);
}