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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract QueryBuilderConvert to an ElasticsearchQueryBuilderall set up to execute the query.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.source()Location in the source statement.toString()
-
Constructor Details
-
Query
-
-
Method Details
-
source
Location in the source statement. -
asBuilder
Convert to an ElasticsearchQueryBuilderall set up to execute the query. -
innerToString
Used bytoString()to produce a pretty string. -
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.
-