java.lang.Object
co.elastic.clients.elasticsearch._types.query_dsl.Query
All Implemented Interfaces:
AggregationVariant, JsonpSerializable, TaggedUnion<java.lang.Object>, UnionVariant

@JsonpDeserializable
public class Query
extends java.lang.Object
implements TaggedUnion<java.lang.Object>, AggregationVariant, JsonpSerializable
  • Field Details

  • Constructor Details

  • Method Details

    • _variantType

      public java.lang.String _variantType()
      Aggregation variant type
      Specified by:
      _variantType in interface UnionVariant
    • _type

      public java.lang.String _type()
      Description copied from interface: TaggedUnion
      Get the of the type of the variant held by this union object.
      Specified by:
      _type in interface TaggedUnion<java.lang.Object>
      Returns:
      the variant type
    • _get

      public java.lang.Object _get()
      Specified by:
      _get in interface TaggedUnion<java.lang.Object>
    • bool

      public BoolQuery bool()
      Get the bool variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the bool kind.
    • boosting

      public BoostingQuery boosting()
      Get the boosting variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the boosting kind.
    • common

      public CommonTermsQuery common()
      Get the common variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the common kind.
    • combinedFields

      public CombinedFieldsQuery combinedFields()
      Get the combined_fields variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the combined_fields kind.
    • constantScore

      public ConstantScoreQuery constantScore()
      Get the constant_score variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the constant_score kind.
    • disMax

      public DisMaxQuery disMax()
      Get the dis_max variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the dis_max kind.
    • distanceFeature

      public jakarta.json.JsonValue distanceFeature()
      Get the distance_feature variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the distance_feature kind.
    • exists

      public ExistsQuery exists()
      Get the exists variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the exists kind.
    • functionScore

      public FunctionScoreQuery functionScore()
      Get the function_score variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the function_score kind.
    • fuzzy

      public FuzzyQuery fuzzy()
      Get the fuzzy variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the fuzzy kind.
    • geoBoundingBox

      public GeoBoundingBoxQuery geoBoundingBox()
      Get the geo_bounding_box variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the geo_bounding_box kind.
    • geoDistance

      public GeoDistanceQuery geoDistance()
      Get the geo_distance variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the geo_distance kind.
    • geoPolygon

      public GeoPolygonQuery geoPolygon()
      Get the geo_polygon variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the geo_polygon kind.
    • geoShape

      public GeoShapeQuery geoShape()
      Get the geo_shape variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the geo_shape kind.
    • hasChild

      public HasChildQuery hasChild()
      Get the has_child variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the has_child kind.
    • hasParent

      public HasParentQuery hasParent()
      Get the has_parent variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the has_parent kind.
    • ids

      public IdsQuery ids()
      Get the ids variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the ids kind.
    • intervals

      public IntervalsQuery intervals()
      Get the intervals variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the intervals kind.
    • match

      public MatchQuery match()
      Get the match variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the match kind.
    • matchAll

      public MatchAllQuery matchAll()
      Get the match_all variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the match_all kind.
    • matchBoolPrefix

      public MatchBoolPrefixQuery matchBoolPrefix()
      Get the match_bool_prefix variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the match_bool_prefix kind.
    • matchNone

      public MatchNoneQuery matchNone()
      Get the match_none variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the match_none kind.
    • matchPhrase

      public MatchPhraseQuery matchPhrase()
      Get the match_phrase variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the match_phrase kind.
    • matchPhrasePrefix

      public MatchPhrasePrefixQuery matchPhrasePrefix()
      Get the match_phrase_prefix variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the match_phrase_prefix kind.
    • moreLikeThis

      public MoreLikeThisQuery moreLikeThis()
      Get the more_like_this variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the more_like_this kind.
    • multiMatch

      public MultiMatchQuery multiMatch()
      Get the multi_match variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the multi_match kind.
    • nested

      public NestedQuery nested()
      Get the nested variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the nested kind.
    • parentId

      public ParentIdQuery parentId()
      Get the parent_id variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the parent_id kind.
    • percolate

      public PercolateQuery percolate()
      Get the percolate variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the percolate kind.
    • pinned

      public PinnedQuery pinned()
      Get the pinned variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the pinned kind.
    • prefix

      public PrefixQuery prefix()
      Get the prefix variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the prefix kind.
    • queryString

      public QueryStringQuery queryString()
      Get the query_string variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the query_string kind.
    • range

      public jakarta.json.JsonValue range()
      Get the range variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the range kind.
    • rankFeature

      public RankFeatureQuery rankFeature()
      Get the rank_feature variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the rank_feature kind.
    • regexp

      public RegexpQuery regexp()
      Get the regexp variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the regexp kind.
    • script

      public ScriptQuery script()
      Get the script variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the script kind.
    • scriptScore

      public ScriptScoreQuery scriptScore()
      Get the script_score variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the script_score kind.
    • shape

      public ShapeQuery shape()
      Get the shape variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the shape kind.
    • simpleQueryString

      public SimpleQueryStringQuery simpleQueryString()
      Get the simple_query_string variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the simple_query_string kind.
    • spanContaining

      public SpanContainingQuery spanContaining()
      Get the span_containing variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the span_containing kind.
    • fieldMaskingSpan

      public SpanFieldMaskingQuery fieldMaskingSpan()
      Get the field_masking_span variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the field_masking_span kind.
    • spanFirst

      public SpanFirstQuery spanFirst()
      Get the span_first variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the span_first kind.
    • spanMulti

      public SpanMultiTermQuery spanMulti()
      Get the span_multi variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the span_multi kind.
    • spanNear

      public SpanNearQuery spanNear()
      Get the span_near variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the span_near kind.
    • spanNot

      public SpanNotQuery spanNot()
      Get the span_not variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the span_not kind.
    • spanOr

      public SpanOrQuery spanOr()
      Get the span_or variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the span_or kind.
    • spanTerm

      public SpanTermQuery spanTerm()
      Get the span_term variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the span_term kind.
    • spanWithin

      public SpanWithinQuery spanWithin()
      Get the span_within variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the span_within kind.
    • term

      public TermQuery term()
      Get the term variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the term kind.
    • terms

      public TermsQuery terms()
      Get the terms variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the terms kind.
    • termsSet

      public TermsSetQuery termsSet()
      Get the terms_set variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the terms_set kind.
    • wildcard

      public WildcardQuery wildcard()
      Get the wildcard variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the wildcard kind.
    • type

      public TypeQuery type()
      Get the type variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the type kind.
    • serialize

      public void serialize​(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Specified by:
      serialize in interface JsonpSerializable
    • setupQueryDeserializer

      protected static void setupQueryDeserializer​(DelegatingDeserializer<Query.Builder> op)