Package io.milvus.param.dml
Class HybridSearchParam.Builder
java.lang.Object
io.milvus.param.dml.HybridSearchParam.Builder
- Enclosing class:
HybridSearchParam
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).addSearchRequest(@NonNull AnnSearchParam searchParam) Adds a vector search request for a vector field.build()Verifies parameters and creates a newHybridSearchParaminstance.withCollectionName(@NonNull String collectionName) Sets the collection name.withConsistencyLevel(ConsistencyLevelEnum consistencyLevel) ConsistencyLevel of consistency level.withDatabaseName(String databaseName) Sets the database name.withGroupByFieldName(@NonNull String groupByFieldName) Groups the results by a scalar field name.withGroupSize(@NonNull Integer groupSize) Defines the max number of items for each group, the value must greater than zero.withOutFields(@NonNull List<String> outFields) Specifies output fields (Optional).withPartitionNames(@NonNull List<String> partitionNames) Sets partition names list to specify search scope (Optional).withRanker(@NonNull BaseRanker ranker) Set a ranker for rearranging number of limit results.withRoundDecimal(@NonNull Integer decimal) Specifies the decimal place of the returned results.withStrictGroupSize(@NonNull Boolean strictGroupSize) Whether to force the number of each group to be groupSize.Sets topK value of ANN search.
-
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
-
addPartitionName
Adds a partition to specify search scope (Optional).- Parameters:
partitionName- partition name- Returns:
Builder
-
addSearchRequest
Adds a vector search request for a vector field.- Parameters:
searchParam- vector search request- Returns:
Builder
-
withRanker
Set a ranker for rearranging number of limit results.- Parameters:
ranker- concrete ranker object- Returns:
Builder
-
withConsistencyLevel
ConsistencyLevel of consistency level.- Parameters:
consistencyLevel- consistency level- Returns:
Builder
-
withTopK
Sets topK value of ANN search.- Parameters:
topK- topK value- Returns:
Builder
-
withOutFields
Specifies output fields (Optional).- Parameters:
outFields- output fields- Returns:
Builder
-
addOutField
Specifies an output field (Optional).- Parameters:
fieldName- filed name- Returns:
Builder
-
withRoundDecimal
Specifies the decimal place of the returned results.- Parameters:
decimal- how many digits after the decimal point- Returns:
Builder
-
withGroupByFieldName
Groups the results by a scalar field name.- Parameters:
fieldName- a scalar field name- Returns:
Builder
-
withGroupSize
Defines the max number of items for each group, the value must greater than zero.- Parameters:
groupSize- the max number of items- Returns:
Builder
-
withStrictGroupSize
Whether to force the number of each group to be groupSize. Set to false, milvus might return some groups with number of items less than groupSize.- Parameters:
strictGroupSize- whether to force the number of each group to be groupSize- Returns:
Builder
-
build
Verifies parameters and creates a newHybridSearchParaminstance.- Returns:
HybridSearchParam- Throws:
ParamException
-