Package io.milvus.param
Class QueryNodeSingleSearch.Builder
java.lang.Object
io.milvus.param.QueryNodeSingleSearch.Builder
- Enclosing class:
QueryNodeSingleSearch
Builder for
QueryNodeSingleSearch-
Method Summary
Modifier and TypeMethodDescriptionbuild()Verifies parameters and creates a newQueryNodeSingleSearchinstance.withCollectionName(@NonNull String collectionName) Sets the collection name.withMetricType(@NonNull MetricType metricType) Sets metric type of ANN searching.withParams(@NonNull String params) Sets the search parameters specific to the index type.withVectorFieldName(@NonNull String vectorFieldName) Sets target vector field by name.withVectors(@NonNull List<?> vectors) Sets the target vectors.
-
Method Details
-
withCollectionName
Sets the collection name. Collection name cannot be empty or null.- Parameters:
collectionName- collection name- Returns:
Builder
-
withMetricType
Sets metric type of ANN searching.- Parameters:
metricType- metric type- Returns:
Builder
-
withVectorFieldName
Sets target vector field by name. Field name cannot be empty or null.- Parameters:
vectorFieldName- vector field name- Returns:
Builder
-
withVectors
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/Float16Vector/BFloat16Vector, vectors is List of ByteBuffer if vector type is SparseFloatVector, values is List of SortedMap[Long, Float]- Returns:
Builder
-
withParams
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
Verifies parameters and creates a newQueryNodeSingleSearchinstance.- Returns:
QueryNodeSingleSearch- Throws:
ParamException
-