Package io.milvus.param.dml
Class HybridSearchParam.Builder
- java.lang.Object
-
- io.milvus.param.dml.HybridSearchParam.Builder
-
- Enclosing class:
- HybridSearchParam
public static class HybridSearchParam.Builder extends Object
Builder forSearchParamclass.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description HybridSearchParam.BuilderaddOutField(String fieldName)Specifies an output field (Optional).HybridSearchParam.BuilderaddPartitionName(String partitionName)Adds a partition to specify search scope (Optional).HybridSearchParam.BuilderaddSearchRequest(AnnSearchParam searchParam)Adds a vector search request for a vector field.HybridSearchParambuild()Verifies parameters and creates a newHybridSearchParaminstance.HybridSearchParam.BuilderwithCollectionName(String collectionName)Sets the collection name.HybridSearchParam.BuilderwithConsistencyLevel(ConsistencyLevelEnum consistencyLevel)ConsistencyLevel of consistency level.HybridSearchParam.BuilderwithDatabaseName(String databaseName)Sets the database name.HybridSearchParam.BuilderwithGroupByFieldName(String groupByFieldName)Groups the results by a scalar field name.HybridSearchParam.BuilderwithGroupSize(Integer groupSize)Defines the max number of items for each group, the value must greater than zero.HybridSearchParam.BuilderwithLimit(Long limit)HybridSearchParam.BuilderwithOffset(Long offset)Specifies the offset place of the returned results.HybridSearchParam.BuilderwithOutFields(List<String> outFields)Specifies output fields (Optional).HybridSearchParam.BuilderwithPartitionNames(List<String> partitionNames)Sets partition names list to specify search scope (Optional).HybridSearchParam.BuilderwithRanker(BaseRanker ranker)Set a ranker for rearranging number of limit results.HybridSearchParam.BuilderwithRoundDecimal(Integer decimal)Specifies the decimal place of the returned results.HybridSearchParam.BuilderwithStrictGroupSize(Boolean strictGroupSize)Whether to force the number of each group to be groupSize.HybridSearchParam.BuilderwithTopK(Integer topK)Deprecated.
-
-
-
Method Detail
-
withDatabaseName
public HybridSearchParam.Builder withDatabaseName(String databaseName)
Sets the database name. database name can be nil.- Parameters:
databaseName- database name- Returns:
Builder
-
withCollectionName
public HybridSearchParam.Builder withCollectionName(String collectionName)
Sets the collection name. Collection name cannot be empty or null.- Parameters:
collectionName- collection name- Returns:
Builder
-
withPartitionNames
public HybridSearchParam.Builder withPartitionNames(List<String> partitionNames)
Sets partition names list to specify search scope (Optional).- Parameters:
partitionNames- partition names list- Returns:
Builder
-
addPartitionName
public HybridSearchParam.Builder addPartitionName(String partitionName)
Adds a partition to specify search scope (Optional).- Parameters:
partitionName- partition name- Returns:
Builder
-
addSearchRequest
public HybridSearchParam.Builder addSearchRequest(AnnSearchParam searchParam)
Adds a vector search request for a vector field.- Parameters:
searchParam- vector search request- Returns:
Builder
-
withRanker
public HybridSearchParam.Builder withRanker(BaseRanker ranker)
Set a ranker for rearranging number of limit results.- Parameters:
ranker- concrete ranker object- Returns:
Builder
-
withConsistencyLevel
public HybridSearchParam.Builder withConsistencyLevel(ConsistencyLevelEnum consistencyLevel)
ConsistencyLevel of consistency level.- Parameters:
consistencyLevel- consistency level- Returns:
Builder
-
withTopK
@Deprecated public HybridSearchParam.Builder withTopK(Integer topK)
Deprecated.Sets topK value of ANN search. withTopK() is deprecated, replaced by withLimit()- Parameters:
topK- topK value- Returns:
Builder
-
withLimit
public HybridSearchParam.Builder withLimit(Long limit)
-
withOutFields
public HybridSearchParam.Builder withOutFields(List<String> outFields)
Specifies output fields (Optional).- Parameters:
outFields- output fields- Returns:
Builder
-
addOutField
public HybridSearchParam.Builder addOutField(String fieldName)
Specifies an output field (Optional).- Parameters:
fieldName- filed name- Returns:
Builder
-
withOffset
public HybridSearchParam.Builder withOffset(Long offset)
Specifies the offset place of the returned results.- Parameters:
offset- the offset position- Returns:
Builder
-
withRoundDecimal
public HybridSearchParam.Builder withRoundDecimal(Integer decimal)
Specifies the decimal place of the returned results.- Parameters:
decimal- how many digits after the decimal point- Returns:
Builder
-
withGroupByFieldName
public HybridSearchParam.Builder withGroupByFieldName(String groupByFieldName)
Groups the results by a scalar field name.- Parameters:
groupByFieldName- a scalar field name- Returns:
Builder
-
withGroupSize
public HybridSearchParam.Builder withGroupSize(Integer groupSize)
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
public HybridSearchParam.Builder withStrictGroupSize(Boolean strictGroupSize)
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
public HybridSearchParam build() throws ParamException
Verifies parameters and creates a newHybridSearchParaminstance.- Returns:
HybridSearchParam- Throws:
ParamException
-
-