Class Query
java.lang.Object
org.elasticsearch.xpack.esql.core.querydsl.query.Query
- Direct Known Subclasses:
BoolQuery,ExistsQuery,GeoDistanceQuery,MatchAll,NotQuery,PrefixQuery,QueryStringQuery,RangeQuery,RegexQuery,TermQuery,TermsQuery,WildcardQuery
Intermediate representation of queries that is rewritten to fetch
otherwise unreferenced nested fields and then used to build
Elasticsearch
QueryBuilders.
Our expression language spits out one of three values for any
comparison, true, false, and null.
Lucene's queries either match or don't match. They don't have
a concept of null, at least not in the sense we need.
The Lucene queries produced by asBuilder() produce
queries that do not match documents who's comparison would
return null. This is what we want in WHERE
style operations. But when you need to negate the matches you
need to make only false return values into matches -
null returns should continue to not match. You can
do that with the negate(org.elasticsearch.xpack.esql.core.tree.Source) method.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract QueryBuilderUsed internally to convert to retrieve aQueryBuilderby queries.abstract booleanDoes the result of callingasBuilder()need the plan to serialize itself?booleaninthashCode()protected abstract StringUsed bytoString()to produce a pretty string.Negate this query, returning a query that includes documents that would returnfalsewhen running the represented operation.booleanscorable()Defines whether a query should contribute to the overall scoresource()Location in the source statement.final QueryBuilderConvert to an ElasticsearchQueryBuilderall set up to execute the query.toString()static QueryBuilderunscore(QueryBuilder builder) Removes score from a query builder, so score is not affected by the query
-
Field Details
-
NO_SCORE_BOOST
public static final float NO_SCORE_BOOST- See Also:
-
-
Constructor Details
-
Query
-
-
Method Details
-
source
Location in the source statement. -
toQueryBuilder
Convert to an ElasticsearchQueryBuilderall set up to execute the query. This ensures that queries have appropriate boosting for scoring. -
asBuilder
Used internally to convert to retrieve aQueryBuilderby queries. -
innerToString
Used bytoString()to produce a pretty string. -
containsPlan
public abstract boolean containsPlan()Does the result of callingasBuilder()need the plan to serialize itself? -
equals
-
hashCode
public int hashCode() -
toString
-
negate
Negate this query, returning a query that includes documents that would returnfalsewhen running the represented operation. The default implementation just returns aNotQuerywrappingthisbecause most queries don't model underlying operations that can returnnull. Queries that model expressions that can returnnullmust make sure all documents that would returnnullare still excluded from the match. -
scorable
public boolean scorable()Defines whether a query should contribute to the overall score -
unscore
Removes score from a query builder, so score is not affected by the query
-