Package io.milvus.param.dml
Class SearchParam.Builder
java.lang.Object
io.milvus.param.dml.SearchParam.Builder
- Enclosing class:
SearchParam
Builder for
SearchParam class.-
Method Summary
Modifier and TypeMethodDescriptionaddOutField(@NonNull String fieldName) Specifies an output field (Optional).addPartitionName(@NonNull String partitionName) Adds a partition to specify search scope (Optional).build()Verifies parameters and creates a newSearchParaminstance.withCollectionName(@NonNull String collectionName) Sets the collection name.withConsistencyLevel(ConsistencyLevelEnum consistencyLevel) ConsistencyLevel of consistency level.withDatabaseName(String databaseName) Sets the database name.Sets expression to filter out entities before searching (Optional).withIgnoreGrowing(@NonNull Boolean ignoreGrowing) Ignore the growing segments to get best search performance.withMetricType(@NonNull MetricType metricType) Sets metric type of ANN searching.withOutFields(@NonNull List<String> outFields) Specifies output fields (Optional).withParams(@NonNull String params) Sets the search parameters specific to the index type.withPartitionNames(@NonNull List<String> partitionNames) Sets partition names list to specify search scope (Optional).withRoundDecimal(@NonNull Integer decimal) Specifies the decimal place of the returned results.Sets topK value of ANN search.withVectorFieldName(@NonNull String vectorFieldName) Sets target vector field by name.withVectors(@NonNull List<?> vectors) Sets the target vectors.
-
Method Details
-
withDatabaseName
Sets the database name. database name can be nil.- Parameters:
databaseName- database name- Returns:
Builder
-
withCollectionName
Sets the collection name. Collection name cannot be empty or null.- Parameters:
collectionName- collection name- Returns:
Builder
-
withPartitionNames
Sets partition names list to specify search scope (Optional).- Parameters:
partitionNames- partition names list- Returns:
Builder
-
withConsistencyLevel
ConsistencyLevel of consistency level.- Parameters:
consistencyLevel- consistency level- Returns:
Builder
-
addPartitionName
Adds a partition to specify search scope (Optional).- Parameters:
partitionName- partition 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
-
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:
-
withOutFields
Specifies output fields (Optional).- Parameters:
outFields- output fields- Returns:
Builder
-
addOutField
Specifies an output field (Optional).- Parameters:
fieldName- filed 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, vectors is List of ByteBuffer;- Returns:
Builder
-
withRoundDecimal
Specifies the decimal place of the returned results.- Parameters:
decimal- how many digits after the decimal point- 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
-
withIgnoreGrowing
Ignore the growing segments to get best search performance. Default is False. For the user case that don't require data visibility.- Parameters:
ignoreGrowing-Boolean.TRUEignore, Boolean.FALSE is not- Returns:
Builder
-
build
Verifies parameters and creates a newSearchParaminstance.- Returns:
SearchParam- Throws:
ParamException
-