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

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

Introduction

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

Prototype

public static float nextUp(float f) 

Source Link

Document

Return the least float that compares greater 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 {/* w w  w.ja v a  2 s.  co  m*/
        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);
}