Package org.elasticsearch.index.query
Interface QueryBuilder
-
- All Superinterfaces:
NamedWriteable
,Rewriteable<QueryBuilder>
,ToXContent
,ToXContentObject
,Writeable
- All Known Subinterfaces:
MultiTermQueryBuilder
,SpanQueryBuilder
- All Known Implementing Classes:
AbstractQueryBuilder
,BaseTermQueryBuilder
,BoolQueryBuilder
,BoostingQueryBuilder
,CommonTermsQueryBuilder
,ConstantScoreQueryBuilder
,DisMaxQueryBuilder
,ExistsQueryBuilder
,FieldMaskingSpanQueryBuilder
,FunctionScoreQueryBuilder
,FuzzyQueryBuilder
,GeoBoundingBoxQueryBuilder
,GeoDistanceQueryBuilder
,GeoPolygonQueryBuilder
,GeoShapeQueryBuilder
,IdsQueryBuilder
,MatchAllQueryBuilder
,MatchNoneQueryBuilder
,MatchPhrasePrefixQueryBuilder
,MatchPhraseQueryBuilder
,MatchQueryBuilder
,MoreLikeThisQueryBuilder
,MultiMatchQueryBuilder
,NestedQueryBuilder
,PrefixQueryBuilder
,QueryStringQueryBuilder
,RangeQueryBuilder
,RegexpQueryBuilder
,ScriptQueryBuilder
,SimpleQueryStringBuilder
,SpanContainingQueryBuilder
,SpanFirstQueryBuilder
,SpanMultiTermQueryBuilder
,SpanNearQueryBuilder
,SpanNearQueryBuilder.SpanGapQueryBuilder
,SpanNotQueryBuilder
,SpanOrQueryBuilder
,SpanTermQueryBuilder
,SpanWithinQueryBuilder
,TermQueryBuilder
,TermsQueryBuilder
,TermsSetQueryBuilder
,TypeQueryBuilder
,WildcardQueryBuilder
,WrapperQueryBuilder
public interface QueryBuilder extends NamedWriteable, ToXContentObject, Rewriteable<QueryBuilder>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, 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 Type Method Description float
boost()
Returns the boost for this query.QueryBuilder
boost(float boost)
Sets the boost for this query.java.lang.String
getName()
Returns the name that identifies uniquely the queryjava.lang.String
queryName()
Returns the arbitrary name assigned to the query (see named queries).QueryBuilder
queryName(java.lang.String queryName)
Sets the arbitrary name to be assigned to the query (see named queries).default QueryBuilder
rewrite(QueryRewriteContext queryShardContext)
Rewrites this query builder into its primitive form.org.apache.lucene.search.Query
toFilter(QueryShardContext context)
Converts this QueryBuilder to an unscored luceneQuery
that acts as a filter.org.apache.lucene.search.Query
toQuery(QueryShardContext 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 Detail
-
toQuery
org.apache.lucene.search.Query toQuery(QueryShardContext context) throws java.io.IOException
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:
java.io.IOException
-
toFilter
org.apache.lucene.search.Query toFilter(QueryShardContext context) throws java.io.IOException
Converts this QueryBuilder to an unscored luceneQuery
that acts as a filter. 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:
java.io.IOException
-
queryName
QueryBuilder queryName(java.lang.String 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
java.lang.String queryName()
Returns the arbitrary name assigned to the query (see named queries).
-
boost
float boost()
Returns the boost for this query.
-
boost
QueryBuilder boost(float 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
java.lang.String getName()
Returns the name that identifies uniquely the query
-
rewrite
default QueryBuilder rewrite(QueryRewriteContext queryShardContext) throws java.io.IOException
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:
java.io.IOException
-
-