java.lang.Object
org.opensearch.client.util.TaggedUnion<QueryContainer.Tag,​java.lang.Object>
org.opensearch.client.opensearch._types.query_dsl.QueryContainer
All Implemented Interfaces:
ToJsonp

public class QueryContainer
extends TaggedUnion<QueryContainer.Tag,​java.lang.Object>
implements ToJsonp
  • Field Details

  • Method Details

    • isBool

      public boolean isBool()
      Is this QueryContainer of a bool kind?
    • bool

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

      public boolean isBoosting()
      Is this QueryContainer of a boosting kind?
    • boosting

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

      public boolean isCommon()
      Is this QueryContainer of a common kind?
    • common

      public NamedValue<jakarta.json.JsonValue> common()
      Get the common variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the common kind.
    • isCombinedFields

      public boolean isCombinedFields()
      Is this QueryContainer of a combined_fields 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.
    • isConstantScore

      public boolean isConstantScore()
      Is this QueryContainer of a constant_score 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.
    • isDisMax

      public boolean isDisMax()
      Is this QueryContainer of a dis_max 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.
    • isDistanceFeature

      public boolean isDistanceFeature()
      Is this QueryContainer of a distance_feature 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.
    • isExists

      public boolean isExists()
      Is this QueryContainer of a exists kind?
    • exists

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

      public boolean isFunctionScore()
      Is this QueryContainer of a function_score 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.
    • isFuzzy

      public boolean isFuzzy()
      Is this QueryContainer of a fuzzy kind?
    • fuzzy

      public NamedValue<jakarta.json.JsonValue> fuzzy()
      Get the fuzzy variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the fuzzy kind.
    • isGeoBoundingBox

      public boolean isGeoBoundingBox()
      Is this QueryContainer of a geo_bounding_box kind?
    • geoBoundingBox

      public NamedQuery<jakarta.json.JsonValue> geoBoundingBox()
      Get the geo_bounding_box variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the geo_bounding_box kind.
    • isGeoDistance

      public boolean isGeoDistance()
      Is this QueryContainer of a geo_distance 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.
    • isGeoPolygon

      public boolean isGeoPolygon()
      Is this QueryContainer of a geo_polygon kind?
    • geoPolygon

      public NamedQuery<jakarta.json.JsonValue> geoPolygon()
      Get the geo_polygon variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the geo_polygon kind.
    • isGeoShape

      public boolean isGeoShape()
      Is this QueryContainer of a geo_shape kind?
    • geoShape

      public NamedQuery<jakarta.json.JsonValue> geoShape()
      Get the geo_shape variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the geo_shape kind.
    • isHasChild

      public boolean isHasChild()
      Is this QueryContainer of a has_child 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.
    • isHasParent

      public boolean isHasParent()
      Is this QueryContainer of a has_parent 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.
    • isIds

      public boolean isIds()
      Is this QueryContainer of a ids kind?
    • ids

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

      public boolean isIntervals()
      Is this QueryContainer of a intervals kind?
    • intervals

      public NamedQuery<jakarta.json.JsonValue> intervals()
      Get the intervals variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the intervals kind.
    • isMatch

      public boolean isMatch()
      Is this QueryContainer of a match kind?
    • match

      public NamedQuery<jakarta.json.JsonValue> match()
      Get the match variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the match kind.
    • isMatchAll

      public boolean isMatchAll()
      Is this QueryContainer of a match_all 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.
    • isMatchBoolPrefix

      public boolean isMatchBoolPrefix()
      Is this QueryContainer of a match_bool_prefix kind?
    • matchBoolPrefix

      public NamedQuery<jakarta.json.JsonValue> matchBoolPrefix()
      Get the match_bool_prefix variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the match_bool_prefix kind.
    • isMatchNone

      public boolean isMatchNone()
      Is this QueryContainer of a match_none kind?
    • matchNone

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

      public boolean isMatchPhrase()
      Is this QueryContainer of a match_phrase kind?
    • matchPhrase

      public NamedQuery<jakarta.json.JsonValue> matchPhrase()
      Get the match_phrase variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the match_phrase kind.
    • isMatchPhrasePrefix

      public boolean isMatchPhrasePrefix()
      Is this QueryContainer of a match_phrase_prefix kind?
    • matchPhrasePrefix

      public NamedQuery<jakarta.json.JsonValue> matchPhrasePrefix()
      Get the match_phrase_prefix variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the match_phrase_prefix kind.
    • isMoreLikeThis

      public boolean isMoreLikeThis()
      Is this QueryContainer of a more_like_this 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.
    • isMultiMatch

      public boolean isMultiMatch()
      Is this QueryContainer of a multi_match 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.
    • isNested

      public boolean isNested()
      Is this QueryContainer of a nested kind?
    • nested

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

      public boolean isParentId()
      Is this QueryContainer of a parent_id 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.
    • isPercolate

      public boolean isPercolate()
      Is this QueryContainer of a percolate kind?
    • percolate

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

      public boolean isPinned()
      Is this QueryContainer of a pinned kind?
    • pinned

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

      public boolean isPrefix()
      Is this QueryContainer of a prefix kind?
    • prefix

      public NamedQuery<jakarta.json.JsonValue> prefix()
      Get the prefix variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the prefix kind.
    • isQueryString

      public boolean isQueryString()
      Is this QueryContainer of a query_string 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.
    • isRange

      public boolean isRange()
      Is this QueryContainer of a range kind?
    • range

      public NamedQuery<RangeQuery> range()
      Get the range variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the range kind.
    • isRankFeature

      public boolean isRankFeature()
      Is this QueryContainer of a rank_feature kind?
    • rankFeature

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

      public boolean isRegexp()
      Is this QueryContainer of a regexp kind?
    • regexp

      public NamedQuery<jakarta.json.JsonValue> regexp()
      Get the regexp variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the regexp kind.
    • isScript

      public boolean isScript()
      Is this QueryContainer of a script kind?
    • script

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

      public boolean isScriptScore()
      Is this QueryContainer of a script_score 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.
    • isShape

      public boolean isShape()
      Is this QueryContainer of a shape kind?
    • shape

      public NamedQuery<jakarta.json.JsonValue> shape()
      Get the shape variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the shape kind.
    • isSimpleQueryString

      public boolean isSimpleQueryString()
      Is this QueryContainer of a simple_query_string 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.
    • isSpanContaining

      public boolean isSpanContaining()
      Is this QueryContainer of a span_containing 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.
    • isFieldMaskingSpan

      public boolean isFieldMaskingSpan()
      Is this QueryContainer of a field_masking_span 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.
    • isSpanFirst

      public boolean isSpanFirst()
      Is this QueryContainer of a span_first 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.
    • isSpanMulti

      public boolean isSpanMulti()
      Is this QueryContainer of a span_multi 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.
    • isSpanNear

      public boolean isSpanNear()
      Is this QueryContainer of a span_near 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.
    • isSpanNot

      public boolean isSpanNot()
      Is this QueryContainer of a span_not 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.
    • isSpanOr

      public boolean isSpanOr()
      Is this QueryContainer of a span_or 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.
    • isSpanTerm

      public boolean isSpanTerm()
      Is this QueryContainer of a span_term kind?
    • spanTerm

      public NamedQuery<jakarta.json.JsonValue> spanTerm()
      Get the span_term variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the span_term kind.
    • isSpanWithin

      public boolean isSpanWithin()
      Is this QueryContainer of a span_within 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.
    • isTemplate

      public boolean isTemplate()
      Is this QueryContainer of a template kind?
    • template

      public QueryTemplate template()
      Get the template variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the template kind.
    • isTerm

      public boolean isTerm()
      Is this QueryContainer of a term kind?
    • term

      public NamedQuery<jakarta.json.JsonValue> term()
      Get the term variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the term kind.
    • isTerms

      public boolean isTerms()
      Is this QueryContainer of a terms kind?
    • terms

      public NamedQuery<jakarta.json.JsonValue> terms()
      Get the terms variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the terms kind.
    • isTermsSet

      public boolean isTermsSet()
      Is this QueryContainer of a terms_set kind?
    • termsSet

      public NamedQuery<jakarta.json.JsonValue> termsSet()
      Get the terms_set variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the terms_set kind.
    • isWildcard

      public boolean isWildcard()
      Is this QueryContainer of a wildcard kind?
    • wildcard

      public NamedQuery<jakarta.json.JsonValue> wildcard()
      Get the wildcard variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the wildcard kind.
    • isType

      public boolean isType()
      Is this QueryContainer of a type kind?
    • type

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

      public void toJsonp​(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Specified by:
      toJsonp in interface ToJsonp