Java Code Examples for org.apache.lucene.search.NumericRangeQuery#newDoubleRange()

The following examples show how to use org.apache.lucene.search.NumericRangeQuery#newDoubleRange() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DoubleFieldMapper.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public Query rangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper) {
    return NumericRangeQuery.newDoubleRange(names().indexName(), numericPrecisionStep(),
        lowerTerm == null ? null : parseDoubleValue(lowerTerm),
        upperTerm == null ? null : parseDoubleValue(upperTerm),
        includeLower, includeUpper);
}
 
Example 2
Source File: DoubleFieldMapper.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public Query fuzzyQuery(Object value, Fuzziness fuzziness, int prefixLength, int maxExpansions, boolean transpositions) {
    double iValue = parseDoubleValue(value);
    double iSim = fuzziness.asDouble();
    return NumericRangeQuery.newDoubleRange(names().indexName(), numericPrecisionStep(),
        iValue - iSim,
        iValue + iSim,
        true, true);
}
 
Example 3
Source File: DoubleFieldTypeDefinition.java    From incubator-retired-blur with Apache License 2.0 4 votes vote down vote up
@Override
public Query getNewRangeQuery(String field, String part1, String part2, boolean startInclusive, boolean endInclusive) {
  double p1 = parseDouble(part1);
  double p2 = parseDouble(part2);
  return NumericRangeQuery.newDoubleRange(field, _precisionStep, p1, p2, startInclusive, endInclusive);
}
 
Example 4
Source File: SuperParserTest.java    From incubator-retired-blur with Apache License 2.0 4 votes vote down vote up
private Query rq_i(String field, double min, double max) {
  return NumericRangeQuery.newDoubleRange(field, min, max, true, true);
}