public class GeoShapeQueryBuilder extends AbstractQueryBuilder<GeoShapeQueryBuilder>
QueryBuilder
that builds a GeoShape QueryWriteable.Reader<R>
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_SHAPE_FIELD_NAME |
static java.lang.String |
DEFAULT_SHAPE_INDEX_NAME |
static ShapeRelation |
DEFAULT_SHAPE_RELATION |
static java.lang.String |
NAME |
boost, BOOST_FIELD, DEFAULT_BOOST, NAME_FIELD, queryName
EMPTY_PARAMS
Constructor and Description |
---|
GeoShapeQueryBuilder(java.lang.String fieldName,
ShapeBuilder shape)
Creates a new GeoShapeQueryBuilder whose Query will be against the given
field name using the given Shape
|
GeoShapeQueryBuilder(java.lang.String fieldName,
java.lang.String indexedShapeId,
java.lang.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 |
---|---|
protected boolean |
doEquals(GeoShapeQueryBuilder other)
Indicates whether some other
QueryBuilder object of the same type is "equal to" this one. |
protected int |
doHashCode() |
protected GeoShapeQueryBuilder |
doReadFrom(StreamInput in) |
protected QueryBuilder<GeoShapeQueryBuilder> |
doRewrite(QueryRewriteContext queryShardContext) |
protected org.apache.lucene.search.Query |
doToQuery(QueryShardContext context) |
protected void |
doWriteTo(StreamOutput out) |
protected void |
doXContent(XContentBuilder builder,
ToXContent.Params params) |
java.lang.String |
fieldName() |
static org.apache.lucene.spatial.query.SpatialArgs |
getArgs(ShapeBuilder shape,
ShapeRelation relation) |
java.lang.String |
getWriteableName()
Returns the name of the writeable object
|
java.lang.String |
indexedShapeId() |
java.lang.String |
indexedShapeIndex() |
GeoShapeQueryBuilder |
indexedShapeIndex(java.lang.String indexedShapeIndex)
Sets the name of the index where the indexed Shape can be found
|
java.lang.String |
indexedShapePath() |
GeoShapeQueryBuilder |
indexedShapePath(java.lang.String indexedShapePath)
Sets the path of the field in the indexed Shape document that has the Shape itself
|
java.lang.String |
indexedShapeType() |
ShapeRelation |
relation() |
GeoShapeQueryBuilder |
relation(ShapeRelation relation)
Sets the relation of query shape and indexed shape.
|
ShapeBuilder |
shape() |
SpatialStrategy |
strategy() |
GeoShapeQueryBuilder |
strategy(SpatialStrategy strategy)
Defines which spatial strategy will be used for building the geo shape
Query.
|
addValidationError, boost, boost, convertToBytesRefIfString, convertToStringIfBytesRef, equals, getName, hashCode, printBoostAndQueryName, queryName, queryName, readFrom, readQueries, rewrite, toFilter, toQueries, toQuery, toXContent, writeQueries, writeTo
buildAsBytes, buildAsBytes, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
rewriteQuery
public static final java.lang.String NAME
public static final java.lang.String DEFAULT_SHAPE_INDEX_NAME
public static final java.lang.String DEFAULT_SHAPE_FIELD_NAME
public static final ShapeRelation DEFAULT_SHAPE_RELATION
public GeoShapeQueryBuilder(java.lang.String fieldName, ShapeBuilder shape)
fieldName
- Name of the field that will be queriedshape
- Shape used in the Querypublic GeoShapeQueryBuilder(java.lang.String fieldName, java.lang.String indexedShapeId, java.lang.String indexedShapeType)
fieldName
- Name of the field that will be filteredindexedShapeId
- ID of the indexed Shape that will be used in the QueryindexedShapeType
- Index type of the indexed Shapespublic java.lang.String fieldName()
public ShapeBuilder shape()
public java.lang.String indexedShapeId()
public java.lang.String indexedShapeType()
public GeoShapeQueryBuilder strategy(SpatialStrategy strategy)
strategy
- The spatial strategy to use for building the geo shape Querypublic SpatialStrategy strategy()
public GeoShapeQueryBuilder indexedShapeIndex(java.lang.String indexedShapeIndex)
indexedShapeIndex
- Name of the index where the indexed Shape ispublic java.lang.String indexedShapeIndex()
public GeoShapeQueryBuilder indexedShapePath(java.lang.String indexedShapePath)
indexedShapePath
- Path of the field where the Shape itself is definedpublic java.lang.String indexedShapePath()
public GeoShapeQueryBuilder relation(ShapeRelation relation)
relation
- relation of the shapespublic ShapeRelation relation()
protected org.apache.lucene.search.Query doToQuery(QueryShardContext context)
doToQuery
in class AbstractQueryBuilder<GeoShapeQueryBuilder>
public static org.apache.lucene.spatial.query.SpatialArgs getArgs(ShapeBuilder shape, ShapeRelation relation)
protected void doXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
doXContent
in class AbstractQueryBuilder<GeoShapeQueryBuilder>
java.io.IOException
protected GeoShapeQueryBuilder doReadFrom(StreamInput in) throws java.io.IOException
doReadFrom
in class AbstractQueryBuilder<GeoShapeQueryBuilder>
java.io.IOException
protected void doWriteTo(StreamOutput out) throws java.io.IOException
doWriteTo
in class AbstractQueryBuilder<GeoShapeQueryBuilder>
java.io.IOException
protected boolean doEquals(GeoShapeQueryBuilder other)
AbstractQueryBuilder
QueryBuilder
object of the same type is "equal to" this one.doEquals
in class AbstractQueryBuilder<GeoShapeQueryBuilder>
protected int doHashCode()
doHashCode
in class AbstractQueryBuilder<GeoShapeQueryBuilder>
public java.lang.String getWriteableName()
NamedWriteable
protected QueryBuilder<GeoShapeQueryBuilder> doRewrite(QueryRewriteContext queryShardContext) throws java.io.IOException
doRewrite
in class AbstractQueryBuilder<GeoShapeQueryBuilder>
java.io.IOException