Class Query
- java.lang.Object
-
- org.opensearch.client.opensearch._types.query_dsl.Query
-
- All Implemented Interfaces:
JsonpSerializable,AggregationVariant,TaggedUnion<Query.Kind,java.lang.Object>
@JsonpDeserializable public class Query extends java.lang.Object implements TaggedUnion<Query.Kind,java.lang.Object>, AggregationVariant, JsonpSerializable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classQuery.Builderstatic classQuery.KindQueryvariant kinds.
-
Field Summary
Fields Modifier and Type Field Description static JsonpDeserializer<Query>_DESERIALIZER
-
Constructor Summary
Constructors Constructor Description Query(QueryVariant value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Aggregation.Kind_aggregationKind()Aggregation variant kind.java.lang.Object_get()Query.Kind_kind()Get the of the kind of variant held by this object.BoolQuerybool()Get theboolvariant value.BoostingQueryboosting()Get theboostingvariant value.CombinedFieldsQuerycombinedFields()Get thecombined_fieldsvariant value.CommonTermsQuerycommon()Get thecommonvariant value.ConstantScoreQueryconstantScore()Get theconstant_scorevariant value.DisMaxQuerydisMax()Get thedis_maxvariant value.DistanceFeatureQuerydistanceFeature()Get thedistance_featurevariant value.ExistsQueryexists()Get theexistsvariant value.SpanFieldMaskingQueryfieldMaskingSpan()Get thefield_masking_spanvariant value.FunctionScoreQueryfunctionScore()Get thefunction_scorevariant value.FuzzyQueryfuzzy()Get thefuzzyvariant value.GeoBoundingBoxQuerygeoBoundingBox()Get thegeo_bounding_boxvariant value.GeoDistanceQuerygeoDistance()Get thegeo_distancevariant value.GeoPolygonQuerygeoPolygon()Get thegeo_polygonvariant value.GeoShapeQuerygeoShape()Get thegeo_shapevariant value.HasChildQueryhasChild()Get thehas_childvariant value.HasParentQueryhasParent()Get thehas_parentvariant value.IdsQueryids()Get theidsvariant value.IntervalsQueryintervals()Get theintervalsvariant value.booleanisBool()Is this variant instance of kindbool?booleanisBoosting()Is this variant instance of kindboosting?booleanisCombinedFields()Is this variant instance of kindcombined_fields?booleanisCommon()Is this variant instance of kindcommon?booleanisConstantScore()Is this variant instance of kindconstant_score?booleanisDisMax()Is this variant instance of kinddis_max?booleanisDistanceFeature()Is this variant instance of kinddistance_feature?booleanisExists()Is this variant instance of kindexists?booleanisFieldMaskingSpan()Is this variant instance of kindfield_masking_span?booleanisFunctionScore()Is this variant instance of kindfunction_score?booleanisFuzzy()Is this variant instance of kindfuzzy?booleanisGeoBoundingBox()Is this variant instance of kindgeo_bounding_box?booleanisGeoDistance()Is this variant instance of kindgeo_distance?booleanisGeoPolygon()Is this variant instance of kindgeo_polygon?booleanisGeoShape()Is this variant instance of kindgeo_shape?booleanisHasChild()Is this variant instance of kindhas_child?booleanisHasParent()Is this variant instance of kindhas_parent?booleanisIds()Is this variant instance of kindids?booleanisIntervals()Is this variant instance of kindintervals?booleanisKnn()Is this variant instance of kindknn?booleanisMatch()Is this variant instance of kindmatch?booleanisMatchAll()Is this variant instance of kindmatch_all?booleanisMatchBoolPrefix()Is this variant instance of kindmatch_bool_prefix?booleanisMatchNone()Is this variant instance of kindmatch_none?booleanisMatchPhrase()Is this variant instance of kindmatch_phrase?booleanisMatchPhrasePrefix()Is this variant instance of kindmatch_phrase_prefix?booleanisMoreLikeThis()Is this variant instance of kindmore_like_this?booleanisMultiMatch()Is this variant instance of kindmulti_match?booleanisNested()Is this variant instance of kindnested?booleanisNeural()Is this variant instance of kindneural?booleanisParentId()Is this variant instance of kindparent_id?booleanisPercolate()Is this variant instance of kindpercolate?booleanisPinned()Is this variant instance of kindpinned?booleanisPrefix()Is this variant instance of kindprefix?booleanisQueryString()Is this variant instance of kindquery_string?booleanisRange()Is this variant instance of kindrange?booleanisRankFeature()Is this variant instance of kindrank_feature?booleanisRegexp()Is this variant instance of kindregexp?booleanisScript()Is this variant instance of kindscript?booleanisScriptScore()Is this variant instance of kindscript_score?booleanisShape()Is this variant instance of kindshape?booleanisSimpleQueryString()Is this variant instance of kindsimple_query_string?booleanisSpanContaining()Is this variant instance of kindspan_containing?booleanisSpanFirst()Is this variant instance of kindspan_first?booleanisSpanMulti()Is this variant instance of kindspan_multi?booleanisSpanNear()Is this variant instance of kindspan_near?booleanisSpanNot()Is this variant instance of kindspan_not?booleanisSpanOr()Is this variant instance of kindspan_or?booleanisSpanTerm()Is this variant instance of kindspan_term?booleanisSpanWithin()Is this variant instance of kindspan_within?booleanisTerm()Is this variant instance of kindterm?booleanisTerms()Is this variant instance of kindterms?booleanisTermsSet()Is this variant instance of kindterms_set?booleanisType()Is this variant instance of kindtype?booleanisWildcard()Is this variant instance of kindwildcard?KnnQueryknn()Get theknnvariant value.MatchQuerymatch()Get thematchvariant value.MatchAllQuerymatchAll()Get thematch_allvariant value.MatchBoolPrefixQuerymatchBoolPrefix()Get thematch_bool_prefixvariant value.MatchNoneQuerymatchNone()Get thematch_nonevariant value.MatchPhraseQuerymatchPhrase()Get thematch_phrasevariant value.MatchPhrasePrefixQuerymatchPhrasePrefix()Get thematch_phrase_prefixvariant value.MoreLikeThisQuerymoreLikeThis()Get themore_like_thisvariant value.MultiMatchQuerymultiMatch()Get themulti_matchvariant value.NestedQuerynested()Get thenestedvariant value.NeuralQueryneural()Get theneuralvariant value.static Queryof(java.util.function.Function<Query.Builder,ObjectBuilder<Query>> fn)ParentIdQueryparentId()Get theparent_idvariant value.PercolateQuerypercolate()Get thepercolatevariant value.PinnedQuerypinned()Get thepinnedvariant value.PrefixQueryprefix()Get theprefixvariant value.QueryStringQueryqueryString()Get thequery_stringvariant value.RangeQueryrange()Get therangevariant value.RankFeatureQueryrankFeature()Get therank_featurevariant value.RegexpQueryregexp()Get theregexpvariant value.ScriptQueryscript()Get thescriptvariant value.ScriptScoreQueryscriptScore()Get thescript_scorevariant value.voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)protected static voidsetupQueryDeserializer(ObjectDeserializer<Query.Builder> op)ShapeQueryshape()Get theshapevariant value.SimpleQueryStringQuerysimpleQueryString()Get thesimple_query_stringvariant value.SpanContainingQueryspanContaining()Get thespan_containingvariant value.SpanFirstQueryspanFirst()Get thespan_firstvariant value.SpanMultiTermQueryspanMulti()Get thespan_multivariant value.SpanNearQueryspanNear()Get thespan_nearvariant value.SpanNotQueryspanNot()Get thespan_notvariant value.SpanOrQueryspanOr()Get thespan_orvariant value.SpanTermQueryspanTerm()Get thespan_termvariant value.SpanWithinQueryspanWithin()Get thespan_withinvariant value.TermQueryterm()Get thetermvariant value.TermsQueryterms()Get thetermsvariant value.TermsSetQuerytermsSet()Get theterms_setvariant value.TypeQuerytype()Get thetypevariant value.WildcardQuerywildcard()Get thewildcardvariant value.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opensearch.client.opensearch._types.aggregations.AggregationVariant
_toAggregation
-
-
-
-
Field Detail
-
_DESERIALIZER
public static final JsonpDeserializer<Query> _DESERIALIZER
-
-
Constructor Detail
-
Query
public Query(QueryVariant value)
-
-
Method Detail
-
_aggregationKind
public Aggregation.Kind _aggregationKind()
Aggregation variant kind.- Specified by:
_aggregationKindin interfaceAggregationVariant
-
_kind
public final Query.Kind _kind()
Description copied from interface:TaggedUnionGet the of the kind of variant held by this object.- Specified by:
_kindin interfaceTaggedUnion<Query.Kind,java.lang.Object>- Returns:
- the variant kind
-
_get
public final java.lang.Object _get()
- Specified by:
_getin interfaceTaggedUnion<Query.Kind,java.lang.Object>
-
of
public static Query of(java.util.function.Function<Query.Builder,ObjectBuilder<Query>> fn)
-
isBool
public boolean isBool()
Is this variant instance of kindbool?
-
bool
public BoolQuery bool()
Get theboolvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of theboolkind.
-
isBoosting
public boolean isBoosting()
Is this variant instance of kindboosting?
-
boosting
public BoostingQuery boosting()
Get theboostingvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of theboostingkind.
-
isCommon
public boolean isCommon()
Is this variant instance of kindcommon?
-
common
public CommonTermsQuery common()
Get thecommonvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thecommonkind.
-
isCombinedFields
public boolean isCombinedFields()
Is this variant instance of kindcombined_fields?
-
combinedFields
public CombinedFieldsQuery combinedFields()
Get thecombined_fieldsvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thecombined_fieldskind.
-
isConstantScore
public boolean isConstantScore()
Is this variant instance of kindconstant_score?
-
constantScore
public ConstantScoreQuery constantScore()
Get theconstant_scorevariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of theconstant_scorekind.
-
isDisMax
public boolean isDisMax()
Is this variant instance of kinddis_max?
-
disMax
public DisMaxQuery disMax()
Get thedis_maxvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thedis_maxkind.
-
isDistanceFeature
public boolean isDistanceFeature()
Is this variant instance of kinddistance_feature?
-
distanceFeature
public DistanceFeatureQuery distanceFeature()
Get thedistance_featurevariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thedistance_featurekind.
-
isExists
public boolean isExists()
Is this variant instance of kindexists?
-
exists
public ExistsQuery exists()
Get theexistsvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of theexistskind.
-
isFunctionScore
public boolean isFunctionScore()
Is this variant instance of kindfunction_score?
-
functionScore
public FunctionScoreQuery functionScore()
Get thefunction_scorevariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thefunction_scorekind.
-
isFuzzy
public boolean isFuzzy()
Is this variant instance of kindfuzzy?
-
fuzzy
public FuzzyQuery fuzzy()
Get thefuzzyvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thefuzzykind.
-
isGeoBoundingBox
public boolean isGeoBoundingBox()
Is this variant instance of kindgeo_bounding_box?
-
geoBoundingBox
public GeoBoundingBoxQuery geoBoundingBox()
Get thegeo_bounding_boxvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thegeo_bounding_boxkind.
-
isGeoDistance
public boolean isGeoDistance()
Is this variant instance of kindgeo_distance?
-
geoDistance
public GeoDistanceQuery geoDistance()
Get thegeo_distancevariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thegeo_distancekind.
-
isGeoPolygon
public boolean isGeoPolygon()
Is this variant instance of kindgeo_polygon?
-
geoPolygon
public GeoPolygonQuery geoPolygon()
Get thegeo_polygonvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thegeo_polygonkind.
-
isGeoShape
public boolean isGeoShape()
Is this variant instance of kindgeo_shape?
-
geoShape
public GeoShapeQuery geoShape()
Get thegeo_shapevariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thegeo_shapekind.
-
isHasChild
public boolean isHasChild()
Is this variant instance of kindhas_child?
-
hasChild
public HasChildQuery hasChild()
Get thehas_childvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thehas_childkind.
-
isHasParent
public boolean isHasParent()
Is this variant instance of kindhas_parent?
-
hasParent
public HasParentQuery hasParent()
Get thehas_parentvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thehas_parentkind.
-
isIds
public boolean isIds()
Is this variant instance of kindids?
-
ids
public IdsQuery ids()
Get theidsvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of theidskind.
-
isIntervals
public boolean isIntervals()
Is this variant instance of kindintervals?
-
intervals
public IntervalsQuery intervals()
Get theintervalsvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of theintervalskind.
-
isKnn
public boolean isKnn()
Is this variant instance of kindknn?
-
knn
public KnnQuery knn()
Get theknnvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of theknnkind.
-
isMatch
public boolean isMatch()
Is this variant instance of kindmatch?
-
match
public MatchQuery match()
Get thematchvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thematchkind.
-
isMatchAll
public boolean isMatchAll()
Is this variant instance of kindmatch_all?
-
matchAll
public MatchAllQuery matchAll()
Get thematch_allvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thematch_allkind.
-
isMatchBoolPrefix
public boolean isMatchBoolPrefix()
Is this variant instance of kindmatch_bool_prefix?
-
matchBoolPrefix
public MatchBoolPrefixQuery matchBoolPrefix()
Get thematch_bool_prefixvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thematch_bool_prefixkind.
-
isMatchNone
public boolean isMatchNone()
Is this variant instance of kindmatch_none?
-
matchNone
public MatchNoneQuery matchNone()
Get thematch_nonevariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thematch_nonekind.
-
isMatchPhrase
public boolean isMatchPhrase()
Is this variant instance of kindmatch_phrase?
-
matchPhrase
public MatchPhraseQuery matchPhrase()
Get thematch_phrasevariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thematch_phrasekind.
-
isMatchPhrasePrefix
public boolean isMatchPhrasePrefix()
Is this variant instance of kindmatch_phrase_prefix?
-
matchPhrasePrefix
public MatchPhrasePrefixQuery matchPhrasePrefix()
Get thematch_phrase_prefixvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thematch_phrase_prefixkind.
-
isMoreLikeThis
public boolean isMoreLikeThis()
Is this variant instance of kindmore_like_this?
-
moreLikeThis
public MoreLikeThisQuery moreLikeThis()
Get themore_like_thisvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of themore_like_thiskind.
-
isMultiMatch
public boolean isMultiMatch()
Is this variant instance of kindmulti_match?
-
multiMatch
public MultiMatchQuery multiMatch()
Get themulti_matchvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of themulti_matchkind.
-
isNested
public boolean isNested()
Is this variant instance of kindnested?
-
nested
public NestedQuery nested()
Get thenestedvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thenestedkind.
-
isNeural
public boolean isNeural()
Is this variant instance of kindneural?
-
neural
public NeuralQuery neural()
Get theneuralvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of theneuralkind.
-
isParentId
public boolean isParentId()
Is this variant instance of kindparent_id?
-
parentId
public ParentIdQuery parentId()
Get theparent_idvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of theparent_idkind.
-
isPercolate
public boolean isPercolate()
Is this variant instance of kindpercolate?
-
percolate
public PercolateQuery percolate()
Get thepercolatevariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thepercolatekind.
-
isPinned
public boolean isPinned()
Is this variant instance of kindpinned?
-
pinned
public PinnedQuery pinned()
Get thepinnedvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thepinnedkind.
-
isPrefix
public boolean isPrefix()
Is this variant instance of kindprefix?
-
prefix
public PrefixQuery prefix()
Get theprefixvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of theprefixkind.
-
isQueryString
public boolean isQueryString()
Is this variant instance of kindquery_string?
-
queryString
public QueryStringQuery queryString()
Get thequery_stringvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thequery_stringkind.
-
isRange
public boolean isRange()
Is this variant instance of kindrange?
-
range
public RangeQuery range()
Get therangevariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of therangekind.
-
isRankFeature
public boolean isRankFeature()
Is this variant instance of kindrank_feature?
-
rankFeature
public RankFeatureQuery rankFeature()
Get therank_featurevariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of therank_featurekind.
-
isRegexp
public boolean isRegexp()
Is this variant instance of kindregexp?
-
regexp
public RegexpQuery regexp()
Get theregexpvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of theregexpkind.
-
isScript
public boolean isScript()
Is this variant instance of kindscript?
-
script
public ScriptQuery script()
Get thescriptvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thescriptkind.
-
isScriptScore
public boolean isScriptScore()
Is this variant instance of kindscript_score?
-
scriptScore
public ScriptScoreQuery scriptScore()
Get thescript_scorevariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thescript_scorekind.
-
isShape
public boolean isShape()
Is this variant instance of kindshape?
-
shape
public ShapeQuery shape()
Get theshapevariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of theshapekind.
-
isSimpleQueryString
public boolean isSimpleQueryString()
Is this variant instance of kindsimple_query_string?
-
simpleQueryString
public SimpleQueryStringQuery simpleQueryString()
Get thesimple_query_stringvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thesimple_query_stringkind.
-
isSpanContaining
public boolean isSpanContaining()
Is this variant instance of kindspan_containing?
-
spanContaining
public SpanContainingQuery spanContaining()
Get thespan_containingvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thespan_containingkind.
-
isFieldMaskingSpan
public boolean isFieldMaskingSpan()
Is this variant instance of kindfield_masking_span?
-
fieldMaskingSpan
public SpanFieldMaskingQuery fieldMaskingSpan()
Get thefield_masking_spanvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thefield_masking_spankind.
-
isSpanFirst
public boolean isSpanFirst()
Is this variant instance of kindspan_first?
-
spanFirst
public SpanFirstQuery spanFirst()
Get thespan_firstvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thespan_firstkind.
-
isSpanMulti
public boolean isSpanMulti()
Is this variant instance of kindspan_multi?
-
spanMulti
public SpanMultiTermQuery spanMulti()
Get thespan_multivariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thespan_multikind.
-
isSpanNear
public boolean isSpanNear()
Is this variant instance of kindspan_near?
-
spanNear
public SpanNearQuery spanNear()
Get thespan_nearvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thespan_nearkind.
-
isSpanNot
public boolean isSpanNot()
Is this variant instance of kindspan_not?
-
spanNot
public SpanNotQuery spanNot()
Get thespan_notvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thespan_notkind.
-
isSpanOr
public boolean isSpanOr()
Is this variant instance of kindspan_or?
-
spanOr
public SpanOrQuery spanOr()
Get thespan_orvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thespan_orkind.
-
isSpanTerm
public boolean isSpanTerm()
Is this variant instance of kindspan_term?
-
spanTerm
public SpanTermQuery spanTerm()
Get thespan_termvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thespan_termkind.
-
isSpanWithin
public boolean isSpanWithin()
Is this variant instance of kindspan_within?
-
spanWithin
public SpanWithinQuery spanWithin()
Get thespan_withinvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thespan_withinkind.
-
isTerm
public boolean isTerm()
Is this variant instance of kindterm?
-
term
public TermQuery term()
Get thetermvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thetermkind.
-
isTerms
public boolean isTerms()
Is this variant instance of kindterms?
-
terms
public TermsQuery terms()
Get thetermsvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thetermskind.
-
isTermsSet
public boolean isTermsSet()
Is this variant instance of kindterms_set?
-
termsSet
public TermsSetQuery termsSet()
Get theterms_setvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of theterms_setkind.
-
isWildcard
public boolean isWildcard()
Is this variant instance of kindwildcard?
-
wildcard
public WildcardQuery wildcard()
Get thewildcardvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thewildcardkind.
-
isType
public boolean isType()
Is this variant instance of kindtype?
-
type
public TypeQuery type()
Get thetypevariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thetypekind.
-
serialize
public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)- Specified by:
serializein interfaceJsonpSerializable
-
setupQueryDeserializer
protected static void setupQueryDeserializer(ObjectDeserializer<Query.Builder> op)
-
-