org.elasticsearch.index.query
Class GeoShapeFilterBuilder

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

public class GeoShapeFilterBuilder
extends BaseFilterBuilder

FilterBuilder that builds a GeoShape Filter


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
GeoShapeFilterBuilder(String name, com.spatial4j.core.shape.Shape shape)
          Creates a new GeoShapeFilterBuilder whose Filter will be against the given field name
 
Method Summary
 GeoShapeFilterBuilder cache(boolean cache)
          Sets whether the filter will be cached.
 GeoShapeFilterBuilder cacheKey(String cacheKey)
          Sets the key used for the filter if it is cached
protected  void doXContent(XContentBuilder builder, ToXContent.Params params)
           
 GeoShapeFilterBuilder filterName(String filterName)
          Sets the name of the filter
 GeoShapeFilterBuilder relation(ShapeRelation relation)
          Sets the ShapeRelation that defines how the Shape used in the Filter must relate to indexed Shapes
 
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

GeoShapeFilterBuilder

public GeoShapeFilterBuilder(String name,
                             com.spatial4j.core.shape.Shape shape)
Creates a new GeoShapeFilterBuilder whose Filter will be against the given field name

Parameters:
name - Name of the field that will be filtered
shape - Shape used in the filter
Method Detail

relation

public GeoShapeFilterBuilder relation(ShapeRelation relation)
Sets the ShapeRelation that defines how the Shape used in the Filter must relate to indexed Shapes

Parameters:
relation - ShapeRelation used in the filter
Returns:
this

cache

public GeoShapeFilterBuilder cache(boolean cache)
Sets whether the filter will be cached.

Parameters:
cache - Whether filter will be cached
Returns:
this

cacheKey

public GeoShapeFilterBuilder cacheKey(String cacheKey)
Sets the key used for the filter if it is cached

Parameters:
cacheKey - Key for the Filter if cached
Returns:
this

filterName

public GeoShapeFilterBuilder filterName(String filterName)
Sets the name of the filter

Parameters:
filterName - Name of the filter
Returns:
this

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.