Package io.milvus.param
Class QueryNodeSingleSearch.Builder
- java.lang.Object
-
- io.milvus.param.QueryNodeSingleSearch.Builder
-
- Enclosing class:
- QueryNodeSingleSearch
public static class QueryNodeSingleSearch.Builder extends java.lang.Object
Builder forQueryNodeSingleSearch
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryNodeSingleSearch
build()
Verifies parameters and creates a newQueryNodeSingleSearch
instance.QueryNodeSingleSearch.Builder
withCollectionName(@NonNull java.lang.String collectionName)
Sets the collection name.QueryNodeSingleSearch.Builder
withMetricType(@NonNull MetricType metricType)
Sets metric type of ANN searching.QueryNodeSingleSearch.Builder
withParams(@NonNull java.lang.String params)
Sets the search parameters specific to the index type.QueryNodeSingleSearch.Builder
withVectorFieldName(@NonNull java.lang.String vectorFieldName)
Sets target vector field by name.QueryNodeSingleSearch.Builder
withVectors(@NonNull java.util.List<?> vectors)
Sets the target vectors.
-
-
-
Method Detail
-
withCollectionName
public QueryNodeSingleSearch.Builder withCollectionName(@NonNull @NonNull java.lang.String collectionName)
Sets the collection name. Collection name cannot be empty or null.- Parameters:
collectionName
- collection name- Returns:
Builder
-
withMetricType
public QueryNodeSingleSearch.Builder withMetricType(@NonNull @NonNull MetricType metricType)
Sets metric type of ANN searching.- Parameters:
metricType
- metric type- Returns:
Builder
-
withVectorFieldName
public QueryNodeSingleSearch.Builder withVectorFieldName(@NonNull @NonNull java.lang.String vectorFieldName)
Sets target vector field by name. Field name cannot be empty or null.- Parameters:
vectorFieldName
- vector field name- Returns:
Builder
-
withVectors
public QueryNodeSingleSearch.Builder withVectors(@NonNull @NonNull java.util.List<?> vectors)
Sets the target vectors.- Parameters:
vectors
- list of target vectors: if vector type is FloatVector, vectors is List of List Float if vector type is BinaryVector, vectors is List of ByteBuffer- Returns:
Builder
-
withParams
public QueryNodeSingleSearch.Builder withParams(@NonNull @NonNull java.lang.String params)
Sets the search parameters specific to the index type. For example: IVF index, the search parameters can be "{\"nprobe\":10}" For more information: @see Index Selection- Parameters:
params
- extra parameters in json format- Returns:
Builder
-
build
public QueryNodeSingleSearch build() throws ParamException
Verifies parameters and creates a newQueryNodeSingleSearch
instance.- Returns:
QueryNodeSingleSearch
- Throws:
ParamException
-
-