org.elasticsearch.index.query
Class NumericRangeFilterBuilder

java.lang.Object
  extended by org.elasticsearch.index.query.BaseFilterBuilder
      extended by org.elasticsearch.index.query.NumericRangeFilterBuilder
All Implemented Interfaces:
ToXContent, FilterBuilder

public class NumericRangeFilterBuilder
extends BaseFilterBuilder

A filter that restricts search results to values that are within the given numeric range.

Uses the field data cache (loading all the values for the specified field into memory).


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.MapParams, ToXContent.Params
 
Field Summary
 
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
 
Constructor Summary
NumericRangeFilterBuilder(String name)
          A filter that restricts search results to values that are within the given range.
 
Method Summary
 NumericRangeFilterBuilder cache(boolean cache)
          Should the filter be cached or not.
 NumericRangeFilterBuilder cacheKey(String cacheKey)
           
protected  void doXContent(XContentBuilder builder, ToXContent.Params params)
           
 NumericRangeFilterBuilder filterName(String filterName)
          Sets the filter name for the filter that can be used when searching for matched_filters per hit.
 NumericRangeFilterBuilder from(double from)
          The from part of the filter query.
 NumericRangeFilterBuilder from(float from)
          The from part of the filter query.
 NumericRangeFilterBuilder from(int from)
          The from part of the filter query.
 NumericRangeFilterBuilder from(long from)
          The from part of the filter query.
 NumericRangeFilterBuilder from(Object from)
          The from part of the filter query.
 NumericRangeFilterBuilder gt(double from)
          The from part of the filter query.
 NumericRangeFilterBuilder gt(float from)
          The from part of the filter query.
 NumericRangeFilterBuilder gt(int from)
          The from part of the filter query.
 NumericRangeFilterBuilder gt(long from)
          The from part of the filter query.
 NumericRangeFilterBuilder gt(Object from)
          The from part of the filter query.
 NumericRangeFilterBuilder gte(double from)
          The from part of the filter query.
 NumericRangeFilterBuilder gte(float from)
          The from part of the filter query.
 NumericRangeFilterBuilder gte(int from)
          The from part of the filter query.
 NumericRangeFilterBuilder gte(long from)
          The from part of the filter query.
 NumericRangeFilterBuilder gte(Object from)
          The from part of the filter query.
 NumericRangeFilterBuilder includeLower(boolean includeLower)
          Should the lower bound be included or not.
 NumericRangeFilterBuilder includeUpper(boolean includeUpper)
          Should the upper bound be included or not.
 NumericRangeFilterBuilder lt(double to)
          The to part of the filter query.
 NumericRangeFilterBuilder lt(float to)
          The to part of the filter query.
 NumericRangeFilterBuilder lt(int to)
          The to part of the filter query.
 NumericRangeFilterBuilder lt(long to)
          The to part of the filter query.
 NumericRangeFilterBuilder lt(Object to)
          The to part of the filter query.
 NumericRangeFilterBuilder lte(double to)
          The to part of the filter query.
 NumericRangeFilterBuilder lte(float to)
          The to part of the filter query.
 NumericRangeFilterBuilder lte(int to)
          The to part of the filter query.
 NumericRangeFilterBuilder lte(long to)
          The to part of the filter query.
 NumericRangeFilterBuilder lte(Object to)
          The to part of the filter query.
 NumericRangeFilterBuilder to(double to)
          The to part of the filter query.
 NumericRangeFilterBuilder to(float to)
          The to part of the filter query.
 NumericRangeFilterBuilder to(int to)
          The to part of the filter query.
 NumericRangeFilterBuilder to(long to)
          The to part of the filter query.
 NumericRangeFilterBuilder to(Object to)
          The to part of the filter query.
 
Methods inherited from class org.elasticsearch.index.query.BaseFilterBuilder
toXContent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumericRangeFilterBuilder

public NumericRangeFilterBuilder(String name)
A filter that restricts search results to values that are within the given range.

Parameters:
name - The field name
Method Detail

from

public NumericRangeFilterBuilder from(Object from)
The from part of the filter query. Null indicates unbounded.


from

public NumericRangeFilterBuilder from(int from)
The from part of the filter query. Null indicates unbounded.


from

public NumericRangeFilterBuilder from(long from)
The from part of the filter query. Null indicates unbounded.


from

public NumericRangeFilterBuilder from(float from)
The from part of the filter query. Null indicates unbounded.


from

public NumericRangeFilterBuilder from(double from)
The from part of the filter query. Null indicates unbounded.


gt

public NumericRangeFilterBuilder gt(Object from)
The from part of the filter query. Null indicates unbounded.


gt

public NumericRangeFilterBuilder gt(int from)
The from part of the filter query. Null indicates unbounded.


gt

public NumericRangeFilterBuilder gt(long from)
The from part of the filter query. Null indicates unbounded.


gt

public NumericRangeFilterBuilder gt(float from)
The from part of the filter query. Null indicates unbounded.


gt

public NumericRangeFilterBuilder gt(double from)
The from part of the filter query. Null indicates unbounded.


gte

public NumericRangeFilterBuilder gte(Object from)
The from part of the filter query. Null indicates unbounded.


gte

public NumericRangeFilterBuilder gte(int from)
The from part of the filter query. Null indicates unbounded.


gte

public NumericRangeFilterBuilder gte(long from)
The from part of the filter query. Null indicates unbounded.


gte

public NumericRangeFilterBuilder gte(float from)
The from part of the filter query. Null indicates unbounded.


gte

public NumericRangeFilterBuilder gte(double from)
The from part of the filter query. Null indicates unbounded.


to

public NumericRangeFilterBuilder to(Object to)
The to part of the filter query. Null indicates unbounded.


to

public NumericRangeFilterBuilder to(int to)
The to part of the filter query. Null indicates unbounded.


to

public NumericRangeFilterBuilder to(long to)
The to part of the filter query. Null indicates unbounded.


to

public NumericRangeFilterBuilder to(float to)
The to part of the filter query. Null indicates unbounded.


to

public NumericRangeFilterBuilder to(double to)
The to part of the filter query. Null indicates unbounded.


lt

public NumericRangeFilterBuilder lt(Object to)
The to part of the filter query. Null indicates unbounded.


lt

public NumericRangeFilterBuilder lt(int to)
The to part of the filter query. Null indicates unbounded.


lt

public NumericRangeFilterBuilder lt(long to)
The to part of the filter query. Null indicates unbounded.


lt

public NumericRangeFilterBuilder lt(float to)
The to part of the filter query. Null indicates unbounded.


lt

public NumericRangeFilterBuilder lt(double to)
The to part of the filter query. Null indicates unbounded.


lte

public NumericRangeFilterBuilder lte(Object to)
The to part of the filter query. Null indicates unbounded.


lte

public NumericRangeFilterBuilder lte(int to)
The to part of the filter query. Null indicates unbounded.


lte

public NumericRangeFilterBuilder lte(long to)
The to part of the filter query. Null indicates unbounded.


lte

public NumericRangeFilterBuilder lte(float to)
The to part of the filter query. Null indicates unbounded.


lte

public NumericRangeFilterBuilder lte(double to)
The to part of the filter query. Null indicates unbounded.


includeLower

public NumericRangeFilterBuilder includeLower(boolean includeLower)
Should the lower bound be included or not. Defaults to true.


includeUpper

public NumericRangeFilterBuilder includeUpper(boolean includeUpper)
Should the upper bound be included or not. Defaults to true.


filterName

public NumericRangeFilterBuilder filterName(String filterName)
Sets the filter name for the filter that can be used when searching for matched_filters per hit.


cache

public NumericRangeFilterBuilder cache(boolean cache)
Should the filter be cached or not. Defaults to false.


cacheKey

public NumericRangeFilterBuilder cacheKey(String cacheKey)

doXContent

protected void doXContent(XContentBuilder builder,
                          ToXContent.Params params)
                   throws IOException
Specified by:
doXContent in class BaseFilterBuilder
Throws:
IOException


Copyright © 2009-2012. All Rights Reserved.