Class NeuralQuery
- java.lang.Object
-
- org.opensearch.client.opensearch._types.query_dsl.QueryBase
-
- org.opensearch.client.opensearch._types.query_dsl.NeuralQuery
-
- All Implemented Interfaces:
JsonpSerializable
,PlainJsonSerializable
,QueryVariant
@JsonpDeserializable public class NeuralQuery extends QueryBase implements QueryVariant
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NeuralQuery.Builder
Builder forNeuralQuery
.-
Nested classes/interfaces inherited from class org.opensearch.client.opensearch._types.query_dsl.QueryBase
QueryBase.AbstractBuilder<BuilderT extends QueryBase.AbstractBuilder<BuilderT>>
-
-
Field Summary
Fields Modifier and Type Field Description static JsonpDeserializer<NeuralQuery>
_DESERIALIZER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Query.Kind
_queryKind()
Query variant kind.java.lang.String
field()
Required - The target field.Query
filter()
Optional - A query to filter the results of the query.int
k()
Required - The number of neighbors to return.java.lang.String
modelId()
Optional - The model_id field if the default model for the index or field is set.static NeuralQuery
of(java.util.function.Function<NeuralQuery.Builder,ObjectBuilder<NeuralQuery>> fn)
java.lang.String
queryImage()
Required - The query_image if query_text is not set.java.lang.String
queryText()
Required - The query_text if query_image is not set.protected void
serializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
protected static void
setupNeuralQueryDeserializer(ObjectDeserializer<NeuralQuery.Builder> op)
NeuralQuery.Builder
toBuilder()
-
Methods inherited from class org.opensearch.client.opensearch._types.query_dsl.QueryBase
boost, queryName, serialize, setupQueryBaseDeserializer
-
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.json.PlainJsonSerializable
toJsonString
-
Methods inherited from interface org.opensearch.client.opensearch._types.query_dsl.QueryVariant
_toQuery, toQuery
-
-
-
-
Field Detail
-
_DESERIALIZER
public static final JsonpDeserializer<NeuralQuery> _DESERIALIZER
-
-
Method Detail
-
of
public static NeuralQuery of(java.util.function.Function<NeuralQuery.Builder,ObjectBuilder<NeuralQuery>> fn)
-
_queryKind
public Query.Kind _queryKind()
Query variant kind.- Specified by:
_queryKind
in interfaceQueryVariant
- Returns:
- The query variant kind.
-
field
public final java.lang.String field()
Required - The target field.- Returns:
- The target field.
-
queryText
public final java.lang.String queryText()
Required - The query_text if query_image is not set. Optional - The query_text if query_image is set.- Returns:
- Search query text.
-
queryImage
public final java.lang.String queryImage()
Required - The query_image if query_text is not set. Optional - The query_image if query_text is set.- Returns:
- Search query image.
-
k
public final int k()
Required - The number of neighbors to return.- Returns:
- The number of neighbors to return.
-
modelId
@Nullable public final java.lang.String modelId()
Optional - The model_id field if the default model for the index or field is set. Required - The model_id field if there is no default model set for the index or field.- Returns:
- The model_id field.
-
filter
@Nullable public final Query filter()
Optional - A query to filter the results of the query.- Returns:
- The filter query.
-
serializeInternal
protected void serializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
- Overrides:
serializeInternal
in classQueryBase
-
toBuilder
public NeuralQuery.Builder toBuilder()
-
setupNeuralQueryDeserializer
protected static void setupNeuralQueryDeserializer(ObjectDeserializer<NeuralQuery.Builder> op)
-
-