Package io.milvus.param.dml
Class QueryParam.Builder
java.lang.Object
io.milvus.param.dml.QueryParam.Builder
- Enclosing class:
QueryParam
Builder for
QueryParam class.-
Method Summary
Modifier and TypeMethodDescriptionaddOutField(@NonNull String fieldName) Specifies an output field (Optional).addPartitionName(@NonNull String partitionName) Adds a partition to specify query scope (Optional).build()Verifies parameters and creates a newQueryParaminstance.withCollectionName(@NonNull String collectionName) Sets the collection name.withConsistencyLevel(ConsistencyLevelEnum consistencyLevel) ConsistencyLevel of consistency level.withDatabaseName(String databaseName) Sets the database name.Sets the expression to query entities.withIgnoreGrowing(@NonNull Boolean ignoreGrowing) Ignore the growing segments to get best query performance.withIterator(@NonNull Boolean iterator) Optimizing specifically for iterators can yield correct data results.Specify a value to control the returned number of entities.withOffset(@NonNull Long offset) Specify a position to return results.withOutFields(@NonNull List<String> outFields) Specifies output fields (Optional).withPartitionNames(@NonNull List<String> partitionNames) Sets partition names list to specify query scope (Optional).withReduceStopForBest(@NonNull Boolean reduceStopForBest) Adjust the query using iterators to handle offsets more efficiently during the Reduce step.
-
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
-
withConsistencyLevel
ConsistencyLevel of consistency level.- Parameters:
consistencyLevel- consistency level- Returns:
Builder
-
withPartitionNames
Sets partition names list to specify query scope (Optional).- Parameters:
partitionNames- partition names list- Returns:
Builder
-
addPartitionName
Adds a partition to specify query scope (Optional).- Parameters:
partitionName- partition name- Returns:
Builder
-
withOutFields
Specifies output fields (Optional).- Parameters:
outFields- output fields- Returns:
Builder
-
addOutField
Specifies an output field (Optional).- Parameters:
fieldName- field name- Returns:
Builder
-
withExpr
Sets the expression to query entities.- Parameters:
expr- filtering expression- Returns:
Builder- See Also:
-
withOffset
Specify a position to return results. Only take effect when the 'limit' value is specified. Default value is 0, start from begin.- Parameters:
offset- a value to define the position- Returns:
Builder
-
withLimit
Specify a value to control the returned number of entities. Must be a positive value. Default value is 0, will return without limit.- Parameters:
limit- a value to define the limit of returned entities- Returns:
Builder
-
withIgnoreGrowing
Ignore the growing segments to get best query performance. Default is False. For the user case that don't require data visibility.- Parameters:
ignoreGrowing-Boolean.TRUEignore, Boolean.FALSE is not- Returns:
Builder
-
withReduceStopForBest
Adjust the query using iterators to handle offsets more efficiently during the Reduce step. Default is False.- Parameters:
reduceStopForBest-Boolean.TRUEignore, Boolean.FALSE is not- Returns:
Builder
-
withIterator
Optimizing specifically for iterators can yield correct data results. Default is False.- Parameters:
iterator-Boolean.TRUEignore, Boolean.FALSE is not- Returns:
Builder
-
build
Verifies parameters and creates a newQueryParaminstance.- Returns:
QueryParam- Throws:
ParamException
-