Package io.milvus.param.dml
Class AnnSearchParam.Builder
- java.lang.Object
-
- io.milvus.param.dml.AnnSearchParam.Builder
-
- Enclosing class:
- AnnSearchParam
public static class AnnSearchParam.Builder extends Object
Builder forAnnSearchParamclass.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnnSearchParambuild()Verifies parameters and creates a newAnnSearchParaminstance.AnnSearchParam.BuilderwithBFloat16Vectors(@NonNull List<ByteBuffer> vectors)Sets the target vectors to search on BFloat16Vector field.AnnSearchParam.BuilderwithBinaryVectors(@NonNull List<ByteBuffer> vectors)Sets the target vectors to search on BinaryVector field.AnnSearchParam.BuilderwithExpr(@NonNull String expr)Sets expression to filter out entities before searching (Optional).AnnSearchParam.BuilderwithFloat16Vectors(@NonNull List<ByteBuffer> vectors)Sets the target vectors to search on Float16Vector field.AnnSearchParam.BuilderwithFloatVectors(@NonNull List<List<Float>> vectors)Sets the target vectors to search on FloatVector field.AnnSearchParam.BuilderwithMetricType(@NonNull MetricType metricType)Sets metric type of ANN searching.AnnSearchParam.BuilderwithParams(@NonNull String params)Sets the search parameters specific to the index type.AnnSearchParam.BuilderwithSparseFloatVectors(@NonNull List<SortedMap<Long,Float>> vectors)Sets the target vectors to search on SparseFloatVector field.AnnSearchParam.BuilderwithTopK(@NonNull Integer topK)Sets topK value of ANN search.AnnSearchParam.BuilderwithVectorFieldName(@NonNull String vectorFieldName)Sets target vector field by name.
-
-
-
Method Detail
-
withMetricType
public AnnSearchParam.Builder withMetricType(@NonNull @NonNull MetricType metricType)
Sets metric type of ANN searching.- Parameters:
metricType- metric type- Returns:
Builder
-
withVectorFieldName
public AnnSearchParam.Builder withVectorFieldName(@NonNull @NonNull String vectorFieldName)
Sets target vector field by name. Field name cannot be empty or null.- Parameters:
vectorFieldName- vector field name- Returns:
Builder
-
withTopK
public AnnSearchParam.Builder withTopK(@NonNull @NonNull Integer topK)
Sets topK value of ANN search.- Parameters:
topK- topK value- Returns:
Builder
-
withExpr
public AnnSearchParam.Builder withExpr(@NonNull @NonNull String expr)
Sets expression to filter out entities before searching (Optional).- Parameters:
expr- filtering expression- Returns:
Builder- See Also:
- Boolean Expression Rules
-
withFloatVectors
public AnnSearchParam.Builder withFloatVectors(@NonNull @NonNull List<List<Float>> vectors)
Sets the target vectors to search on FloatVector field.- Parameters:
vectors- target vectors to search- Returns:
Builder
-
withBinaryVectors
public AnnSearchParam.Builder withBinaryVectors(@NonNull @NonNull List<ByteBuffer> vectors)
Sets the target vectors to search on BinaryVector field.- Parameters:
vectors- target vectors to search- Returns:
Builder
-
withFloat16Vectors
public AnnSearchParam.Builder withFloat16Vectors(@NonNull @NonNull List<ByteBuffer> vectors)
Sets the target vectors to search on Float16Vector field.- Parameters:
vectors- target vectors to search- Returns:
Builder
-
withBFloat16Vectors
public AnnSearchParam.Builder withBFloat16Vectors(@NonNull @NonNull List<ByteBuffer> vectors)
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
public AnnSearchParam.Builder withParams(@NonNull @NonNull 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 AnnSearchParam build() throws ParamException
Verifies parameters and creates a newAnnSearchParaminstance.- Returns:
AnnSearchParam- Throws:
ParamException
-
-