Package org.elasticsearch.index.query
Interface QueryBuilder
- All Superinterfaces:
NamedWriteable
,Rewriteable<QueryBuilder>
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentObject
,Writeable
- All Known Subinterfaces:
MultiTermQueryBuilder
,SpanQueryBuilder
- All Known Implementing Classes:
AbstractGeometryQueryBuilder
,AbstractQueryBuilder
,BaseTermQueryBuilder
,BoolQueryBuilder
,BoostingQueryBuilder
,CombinedFieldsQueryBuilder
,CommonTermsQueryBuilder
,ConstantScoreQueryBuilder
,DisMaxQueryBuilder
,DistanceFeatureQueryBuilder
,ExistsQueryBuilder
,FieldMaskingSpanQueryBuilder
,FunctionScoreQueryBuilder
,FuzzyQueryBuilder
,GeoBoundingBoxQueryBuilder
,GeoDistanceQueryBuilder
,GeoPolygonQueryBuilder
,GeoShapeQueryBuilder
,IdsQueryBuilder
,IntervalQueryBuilder
,MatchAllQueryBuilder
,MatchBoolPrefixQueryBuilder
,MatchNoneQueryBuilder
,MatchPhrasePrefixQueryBuilder
,MatchPhraseQueryBuilder
,MatchQueryBuilder
,MoreLikeThisQueryBuilder
,MultiMatchQueryBuilder
,NestedQueryBuilder
,PrefixQueryBuilder
,QueryStringQueryBuilder
,RangeQueryBuilder
,RegexpQueryBuilder
,ScriptQueryBuilder
,ScriptScoreQueryBuilder
,SimpleQueryStringBuilder
,SpanContainingQueryBuilder
,SpanFirstQueryBuilder
,SpanMultiTermQueryBuilder
,SpanNearQueryBuilder
,SpanNearQueryBuilder.SpanGapQueryBuilder
,SpanNotQueryBuilder
,SpanOrQueryBuilder
,SpanTermQueryBuilder
,SpanWithinQueryBuilder
,TermQueryBuilder
,TermsQueryBuilder
,TermsSetQueryBuilder
,TypeQueryBuilder
,WildcardQueryBuilder
,WrapperQueryBuilder
public interface QueryBuilder
extends NamedWriteable, org.elasticsearch.common.xcontent.ToXContentObject, Rewriteable<QueryBuilder>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Fields inherited from interface org.elasticsearch.index.query.Rewriteable
MAX_REWRITE_ROUNDS
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
Method Summary
Modifier and TypeMethodDescriptionfloat
boost()
Returns the boost for this query.boost(float boost)
Sets the boost for this query.getName()
Returns the name that identifies uniquely the queryReturns the arbitrary name assigned to the query (see named queries).Sets the arbitrary name to be assigned to the query (see named queries).default QueryBuilder
rewrite(QueryRewriteContext queryRewriteContext)
Rewrites this query builder into its primitive form.org.apache.lucene.search.Query
toQuery(SearchExecutionContext context)
Converts this QueryBuilder to a luceneQuery
.Methods inherited from interface org.elasticsearch.common.io.stream.NamedWriteable
getWriteableName
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContent
toXContent
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
Method Details
-
toQuery
Converts this QueryBuilder to a luceneQuery
. Returnsnull
if this query should be ignored in the context of parent queries.- Parameters:
context
- additional information needed to construct the queries- Returns:
- the
Query
ornull
if this query should be ignored upstream - Throws:
IOException
-
queryName
Sets the arbitrary name to be assigned to the query (see named queries). Implementers should return the concrete type of theQueryBuilder
so that calls can be chained. This is done automatically when extendingAbstractQueryBuilder
. -
queryName
String queryName()Returns the arbitrary name assigned to the query (see named queries). -
boost
float boost()Returns the boost for this query. -
boost
Sets the boost for this query. Documents matching this query will (in addition to the normal weightings) have their score multiplied by the boost provided. Implementers should return the concrete type of theQueryBuilder
so that calls can be chained. This is done automatically when extendingAbstractQueryBuilder
. -
getName
String getName()Returns the name that identifies uniquely the query -
rewrite
Rewrites this query builder into its primitive form. By default this method return the builder itself. If the builder did not change the identity reference must be returned otherwise the builder will be rewritten infinitely.- Specified by:
rewrite
in interfaceRewriteable<QueryBuilder>
- Throws:
IOException
-