Class MatchedQueries
java.lang.Object
org.opensearch.client.opensearch.core.search.MatchedQueries
- All Implemented Interfaces:
Iterable<String>,Collection<String>,List<String>,SequencedCollection<String>,JsonpSerializable,PlainJsonSerializable,TaggedUnion<MatchedQueries.Kind,Object>
@JsonpDeserializable
public class MatchedQueries
extends Object
implements TaggedUnion<MatchedQueries.Kind,Object>, PlainJsonSerializable, List<String>
The names of queries that matched a hit, with optional per-query scores.
The server returns matched_queries in one of two shapes, and never both: an array of query names when
include_named_queries_score is not set, or an object mapping query names to scores when
include_named_queries_score is true.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfinal Object_get()final MatchedQueries.Kind_kind()Get the of the kind of variant held by this object.voidbooleanbooleanaddAll(int index, Collection<? extends String> c) booleanaddAll(Collection<? extends String> c) static MatchedQueries.Builderbuilder()voidclear()booleanbooleancontainsAll(Collection<?> c) booleanget(int index) inthashCode()intbooleanisEmpty()booleanisNames()Is this variant instance of kindnames?booleanisScores()Is this variant instance of kindscores?iterator()intlistIterator(int index) names()Get thenamesvariant value: the names of the queries that matched the hit, returned by the server wheninclude_named_queries_scoreis not set.static MatchedQueriesstatic MatchedQueriesstatic MatchedQueriesremove(int index) booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) scores()Get thescoresvariant value: a map from matched query name to score, returned by the server wheninclude_named_queries_scoreis true.voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) intsize()subList(int fromIndex, int toIndex) Object[]toArray()<T> T[]toArray(T[] a) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
addFirst, addLast, getFirst, getLast, removeFirst, removeLast, replaceAll, reversed, sort, spliteratorMethods inherited from interface org.opensearch.client.json.PlainJsonSerializable
toJsonString
-
Field Details
-
_DESERIALIZER
-
-
Method Details
-
_kind
Description copied from interface:TaggedUnionGet the of the kind of variant held by this object.- Specified by:
_kindin interfaceTaggedUnion<MatchedQueries.Kind,Object> - Returns:
- the variant kind
-
_get
- Specified by:
_getin interfaceTaggedUnion<MatchedQueries.Kind,Object>
-
of
-
ofNames
-
ofScores
-
isNames
public boolean isNames()Is this variant instance of kindnames? -
names
Get thenamesvariant value: the names of the queries that matched the hit, returned by the server wheninclude_named_queries_scoreis not set.- Throws:
IllegalStateException- if the current variant is not thenameskind.
-
isScores
public boolean isScores()Is this variant instance of kindscores? -
scores
Get thescoresvariant value: a map from matched query name to score, returned by the server wheninclude_named_queries_scoreis true.- Throws:
IllegalStateException- if the current variant is not thescoreskind.
-
serialize
- Specified by:
serializein interfaceJsonpSerializable
-
toBuilder
-
builder
-
hashCode
public int hashCode() -
equals
-
size
public int size() -
isEmpty
public boolean isEmpty() -
contains
-
iterator
-
toArray
-
toArray
public <T> T[] toArray(T[] a) -
add
-
remove
-
containsAll
- Specified by:
containsAllin interfaceCollection<String>- Specified by:
containsAllin interfaceList<String>
-
addAll
-
addAll
-
removeAll
-
retainAll
-
clear
public void clear() -
get
-
set
-
add
-
remove
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<String>
-
listIterator
- Specified by:
listIteratorin interfaceList<String>
-
listIterator
- Specified by:
listIteratorin interfaceList<String>
-
subList
-