Class NeuralQuery.Builder
- java.lang.Object
-
- org.opensearch.client.util.ObjectBuilderBase
-
- org.opensearch.client.opensearch._types.query_dsl.QueryBase.AbstractBuilder<NeuralQuery.Builder>
-
- org.opensearch.client.opensearch._types.query_dsl.NeuralQuery.Builder
-
- All Implemented Interfaces:
ObjectBuilder<NeuralQuery>
- Enclosing class:
- NeuralQuery
public static class NeuralQuery.Builder extends QueryBase.AbstractBuilder<NeuralQuery.Builder> implements ObjectBuilder<NeuralQuery>
Builder forNeuralQuery
.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NeuralQuery
build()
Builds aNeuralQuery
.NeuralQuery.Builder
field(java.lang.String field)
Required - The target field.NeuralQuery.Builder
filter(Query filter)
Optional - A query to filter the results of the knn query.NeuralQuery.Builder
k(java.lang.Integer k)
Required - The number of neighbors to return.NeuralQuery.Builder
modelId(java.lang.String modelId)
Optional - The model_id field if the default model for the index or field is set.NeuralQuery.Builder
queryImage(java.lang.String queryImage)
Required - The query_image if query_text is not set.NeuralQuery.Builder
queryText(java.lang.String queryText)
Required - The query_text if query_image is not set.protected NeuralQuery.Builder
self()
-
Methods inherited from class org.opensearch.client.opensearch._types.query_dsl.QueryBase.AbstractBuilder
boost, queryName
-
Methods inherited from class org.opensearch.client.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAdd, _listAddAll, _listAddAll, _mapPut, _mapPutAll
-
-
-
-
Method Detail
-
field
public NeuralQuery.Builder field(@Nullable java.lang.String field)
Required - The target field.- Parameters:
field
- The target field.- Returns:
- This builder.
-
queryText
public NeuralQuery.Builder queryText(@Nullable java.lang.String queryText)
Required - The query_text if query_image is not set. Optional - The query_text if query_image is set.- Parameters:
queryText
- Search query text.- Returns:
- This builder.
-
queryImage
public NeuralQuery.Builder queryImage(@Nullable java.lang.String queryImage)
Required - The query_image if query_text is not set. Optional - The query_image if query_text is set.- Parameters:
queryImage
- Search query image.- Returns:
- This builder.
-
modelId
public NeuralQuery.Builder modelId(@Nullable 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.- Parameters:
modelId
- The model_id field.- Returns:
- This builder.
-
k
public NeuralQuery.Builder k(@Nullable java.lang.Integer k)
Required - The number of neighbors to return.- Parameters:
k
- The number of neighbors to return.- Returns:
- This builder.
-
filter
public NeuralQuery.Builder filter(@Nullable Query filter)
Optional - A query to filter the results of the knn query.- Parameters:
filter
- The filter query.- Returns:
- This builder.
-
self
protected NeuralQuery.Builder self()
- Specified by:
self
in classQueryBase.AbstractBuilder<NeuralQuery.Builder>
-
build
public NeuralQuery build()
Builds aNeuralQuery
.- Specified by:
build
in interfaceObjectBuilder<NeuralQuery>
- Returns:
- The built
NeuralQuery
.
-
-