Package io.milvus.param.dml
Class AnnSearchParam.Builder
java.lang.Object
io.milvus.param.dml.AnnSearchParam.Builder
- Enclosing class:
AnnSearchParam
Builder for
AnnSearchParam class.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Verifies parameters and creates a newAnnSearchParaminstance.withBFloat16Vectors(@NonNull List<ByteBuffer> vectors) Sets the target vectors to search on BFloat16Vector field.withBinaryVectors(@NonNull List<ByteBuffer> vectors) Sets the target vectors to search on BinaryVector field.Sets expression to filter out entities before searching (Optional).withFloat16Vectors(@NonNull List<ByteBuffer> vectors) Sets the target vectors to search on Float16Vector field.withFloatVectors(@NonNull List<List<Float>> vectors) Sets the target vectors to search on FloatVector field.withMetricType(@NonNull MetricType metricType) Sets metric type of ANN searching.withParams(@NonNull String params) Sets the search parameters specific to the index type.withSparseFloatVectors(@NonNull List<SortedMap<Long, Float>> vectors) Sets the target vectors to search on SparseFloatVector field.Sets topK value of ANN search.withVectorFieldName(@NonNull String vectorFieldName) Sets target vector field by name.
-
Method Details
-
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
-
withTopK
Sets topK value of ANN search.- Parameters:
topK- topK value- Returns:
Builder
-
withExpr
Sets expression to filter out entities before searching (Optional).- Parameters:
expr- filtering expression- Returns:
Builder- See Also:
-
withFloatVectors
Sets the target vectors to search on FloatVector field.- Parameters:
vectors- target vectors to search- Returns:
Builder
-
withBinaryVectors
Sets the target vectors to search on BinaryVector field.- Parameters:
vectors- target vectors to search- Returns:
Builder
-
withFloat16Vectors
Sets the target vectors to search on Float16Vector field.- Parameters:
vectors- target vectors to search- Returns:
Builder
-
withBFloat16Vectors
Sets the target vectors to search on BFloat16Vector field.- Parameters:
vectors- target vectors to search- Returns:
Builder
-
withSparseFloatVectors
public AnnSearchParam.Builder withSparseFloatVectors(@NonNull @NonNull List<SortedMap<Long, Float>> vectors) Sets the target vectors to search on SparseFloatVector field.- Parameters:
vectors- target vectors to search- 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 newAnnSearchParaminstance.- Returns:
AnnSearchParam- Throws:
ParamException
-