java.lang.Object
org.elasticsearch.xpack.esql.core.querydsl.query.Query
org.elasticsearch.xpack.esql.core.querydsl.query.NotQuery

public class NotQuery extends Query
Query that inverts the set of matched documents.
  • Constructor Details

    • NotQuery

      public NotQuery(Source source, Query child)
  • Method Details

    • child

      public Query child()
    • asBuilder

      public QueryBuilder asBuilder()
      Description copied from class: Query
      Convert to an Elasticsearch QueryBuilder all set up to execute the query.
      Specified by:
      asBuilder in class Query
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Query
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Query
    • innerToString

      protected String innerToString()
      Description copied from class: Query
      Used by Query.toString() to produce a pretty string.
      Specified by:
      innerToString in class Query
    • negate

      public Query negate(Source source)
      Description copied from class: Query
      Negate this query, returning a query that includes documents that would return false when running the represented operation. The default implementation just returns a NotQuery wrapping this because most queries don't model underlying operations that can return null. Queries that model expressions that can return null must make sure all documents that would return null are still excluded from the match.
      Overrides:
      negate in class Query