public class GeoShapeQueryBuilder extends BaseQueryBuilder implements BoostableQueryBuilder<GeoShapeQueryBuilder>
QueryBuilder
that builds a GeoShape QueryToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
EMPTY_PARAMS
Constructor and Description |
---|
GeoShapeQueryBuilder(String name,
ShapeBuilder shape)
Creates a new GeoShapeQueryBuilder whose Query will be against the
given field name using the given Shape
|
GeoShapeQueryBuilder(String name,
String indexedShapeId,
String indexedShapeType)
Creates a new GeoShapeQueryBuilder whose Query 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 |
---|---|
GeoShapeQueryBuilder |
boost(float boost)
Sets the boost for this query.
|
protected void |
doXContent(XContentBuilder builder,
ToXContent.Params params) |
GeoShapeQueryBuilder |
indexedShapeIndex(String indexedShapeIndex)
Sets the name of the index where the indexed Shape can be found
|
GeoShapeQueryBuilder |
indexedShapePath(String indexedShapePath)
Sets the path of the field in the indexed Shape document that has the Shape itself
|
GeoShapeQueryBuilder |
queryName(String queryName)
Sets the query name for the filter that can be used when searching for matched_filters per hit.
|
GeoShapeQueryBuilder |
strategy(SpatialStrategy strategy)
Defines which spatial strategy will be used for building the geo shape query.
|
buildAsBytes, buildAsBytes, toString, toXContent
public GeoShapeQueryBuilder(String name, ShapeBuilder shape)
name
- Name of the field that will be queriedshape
- Shape used in the querypublic GeoShapeQueryBuilder(String name, String indexedShapeId, String indexedShapeType)
name
- Name of the field that will be queriedindexedShapeId
- ID of the indexed Shape that will be used in the QueryindexedShapeType
- Index type of the indexed Shapespublic GeoShapeQueryBuilder boost(float boost)
boost
in interface BoostableQueryBuilder<GeoShapeQueryBuilder>
public GeoShapeQueryBuilder strategy(SpatialStrategy strategy)
strategy
- The spatial strategy to use for building the geo shape querypublic GeoShapeQueryBuilder indexedShapeIndex(String indexedShapeIndex)
indexedShapeIndex
- Name of the index where the indexed Shape ispublic GeoShapeQueryBuilder indexedShapePath(String indexedShapePath)
indexedShapePath
- path of the field where the Shape itself is definedpublic GeoShapeQueryBuilder queryName(String queryName)
protected void doXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
doXContent
in class BaseQueryBuilder
IOException
Copyright © 2009–2015. All rights reserved.