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 Deprecated Methods Modifier and Type Method Description AnnSearchParambuild()Verifies parameters and creates a newAnnSearchParaminstance.AnnSearchParam.BuilderwithBFloat16Vectors(List<ByteBuffer> vectors)Sets the target vectors to search on BFloat16Vector field.AnnSearchParam.BuilderwithBinaryVectors(List<ByteBuffer> vectors)Sets the target vectors to search on BinaryVector field.AnnSearchParam.BuilderwithExpr(String expr)Sets expression to filter out entities before searching (Optional).AnnSearchParam.BuilderwithFloat16Vectors(List<ByteBuffer> vectors)Sets the target vectors to search on Float16Vector field.AnnSearchParam.BuilderwithFloatVectors(List<List<Float>> vectors)Sets the target vectors to search on FloatVector field.AnnSearchParam.BuilderwithLimit(Long limit)AnnSearchParam.BuilderwithMetricType(MetricType metricType)Sets metric type of ANN searching.AnnSearchParam.BuilderwithParams(String params)Sets the search parameters specific to the index type.AnnSearchParam.BuilderwithSparseFloatVectors(List<SortedMap<Long,Float>> vectors)Sets the target vectors to search on SparseFloatVector field.AnnSearchParam.BuilderwithTopK(Integer topK)Deprecated.AnnSearchParam.BuilderwithVectorFieldName(String vectorFieldName)Sets target vector field by name.
-
-
-
Method Detail
-
withMetricType
public AnnSearchParam.Builder withMetricType(MetricType metricType)
Sets metric type of ANN searching.- Parameters:
metricType- metric type- Returns:
Builder
-
withVectorFieldName
public AnnSearchParam.Builder withVectorFieldName(String vectorFieldName)
Sets target vector field by name. Field name cannot be empty or null.- Parameters:
vectorFieldName- vector field name- Returns:
Builder
-
withTopK
@Deprecated public AnnSearchParam.Builder withTopK(Integer topK)
Deprecated.Sets topK value of ANN search.- Parameters:
topK- topK value- Returns:
Builder
-
withLimit
public AnnSearchParam.Builder withLimit(Long limit)
-
withExpr
public AnnSearchParam.Builder withExpr(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(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(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(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(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(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(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
-
-