public interface QueryBuilder extends NamedWriteable, ToXContentObject
Writeable.Reader<V>, Writeable.Writer<V>
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
EMPTY_PARAMS
Modifier and Type | Method and 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 query
|
java.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.
|
static QueryBuilder |
rewriteQuery(QueryBuilder original,
QueryRewriteContext context)
Rewrites the given query into its primitive form.
|
org.apache.lucene.search.Query |
toFilter(QueryShardContext context)
Converts this QueryBuilder to an unscored lucene
Query that acts as a filter. |
org.apache.lucene.search.Query |
toQuery(QueryShardContext context)
Converts this QueryBuilder to a lucene
Query . |
getWriteableName
isFragment
toXContent
org.apache.lucene.search.Query toQuery(QueryShardContext context) throws java.io.IOException
Query
.
Returns null if this query should be ignored in the context of
parent queries.context
- additional information needed to construct the queriesQuery
or null if this query should be ignored upstreamjava.io.IOException
org.apache.lucene.search.Query toFilter(QueryShardContext context) throws java.io.IOException
Query
that acts as a filter.
Returns null if this query should be ignored in the context of
parent queries.context
- additional information needed to construct the queriesQuery
or null if this query should be ignored upstreamjava.io.IOException
QueryBuilder queryName(java.lang.String queryName)
QueryBuilder
so that calls can be chained. This is done
automatically when extending AbstractQueryBuilder
.java.lang.String queryName()
float boost()
QueryBuilder boost(float boost)
QueryBuilder
so that calls can be chained. This is done
automatically when extending AbstractQueryBuilder
.java.lang.String getName()
default QueryBuilder rewrite(QueryRewriteContext queryShardContext) throws java.io.IOException
java.io.IOException
static QueryBuilder rewriteQuery(QueryBuilder original, QueryRewriteContext context) throws java.io.IOException
rewrite(QueryRewriteContext)
. This method
rewrites the query until it doesn't change anymore.java.io.IOException
- if an IOException
occurs