public class GeoShapeFilterBuilder extends BaseFilterBuilder
FilterBuilder
that builds a GeoShape FilterToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
EMPTY_PARAMS
Constructor and Description |
---|
GeoShapeFilterBuilder(String name,
ShapeBuilder shape)
Creates a new GeoShapeFilterBuilder whose Filter will be against the
given field name using the given Shape
|
GeoShapeFilterBuilder(String name,
ShapeBuilder shape,
ShapeRelation relation)
Creates a new GeoShapeFilterBuilder whose Filter will be against the
given field name using the given Shape
|
GeoShapeFilterBuilder(String name,
String indexedShapeId,
String indexedShapeType,
ShapeRelation relation)
Creates a new GeoShapeFilterBuilder whose Filter will be against the given field name
and will use the Shape found with the given ID in the given type
|
Modifier and Type | Method and Description |
---|---|
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 |
indexedShapeIndex(String indexedShapeIndex)
Sets the name of the index where the indexed Shape can be found
|
GeoShapeFilterBuilder |
indexedShapePath(String indexedShapePath)
Sets the path of the field in the indexed Shape document that has the Shape itself
|
GeoShapeFilterBuilder |
relation(ShapeRelation relation)
Sets the relation of query shape and indexed shape.
|
GeoShapeFilterBuilder |
strategy(SpatialStrategy strategy)
Defines which spatial strategy will be used for building the geo shape filter.
|
buildAsBytes, buildAsBytes, toString, toXContent
public GeoShapeFilterBuilder(String name, ShapeBuilder shape)
name
- Name of the field that will be filteredshape
- Shape used in the filterpublic GeoShapeFilterBuilder(String name, ShapeBuilder shape, ShapeRelation relation)
name
- Name of the field that will be filteredrelation
- ShapeRelation
of query and indexed shapeshape
- Shape used in the filterpublic GeoShapeFilterBuilder(String name, String indexedShapeId, String indexedShapeType, ShapeRelation relation)
name
- Name of the field that will be filteredindexedShapeId
- ID of the indexed Shape that will be used in the FilterindexedShapeType
- Index type of the indexed Shapespublic GeoShapeFilterBuilder cache(boolean cache)
cache
- Whether filter will be cachedpublic GeoShapeFilterBuilder cacheKey(String cacheKey)
cacheKey
- Key for the Filter if cachedpublic GeoShapeFilterBuilder filterName(String filterName)
filterName
- Name of the filterpublic GeoShapeFilterBuilder strategy(SpatialStrategy strategy)
strategy
- The spatial strategy to use for building the geo shape filterpublic GeoShapeFilterBuilder indexedShapeIndex(String indexedShapeIndex)
indexedShapeIndex
- Name of the index where the indexed Shape ispublic GeoShapeFilterBuilder indexedShapePath(String indexedShapePath)
indexedShapePath
- Path of the field where the Shape itself is definedpublic GeoShapeFilterBuilder relation(ShapeRelation relation)
relation
- relation of the shapesprotected void doXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
doXContent
in class BaseFilterBuilder
IOException
Copyright © 2009–2015. All rights reserved.