Package io.milvus.param.dml.ranker
Class WeightedRanker.Builder
- java.lang.Object
-
- io.milvus.param.dml.ranker.WeightedRanker.Builder
-
- Enclosing class:
- WeightedRanker
public static class WeightedRanker.Builder extends Object
Builder forWeightedRankerclass.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WeightedRankerbuild()Verifies parameters and creates a newWeightedRankerinstance.WeightedRanker.BuilderwithWeights(@NonNull List<Float> weights)Assign weights for each AnnSearchParam.
-
-
-
Method Detail
-
withWeights
public WeightedRanker.Builder withWeights(@NonNull @NonNull List<Float> weights)
Assign weights for each AnnSearchParam. The length of weights must be equal to number of AnnSearchParam. You can assign any float value for weight, the sum of weight values can exceed 1. The distance/similarity values of each field will be mapped into a range of [0,1], and score = sum(weights[i] * distance_i_in_[0,1])- Parameters:
weights- weight values- Returns:
Builder
-
build
public WeightedRanker build() throws ParamException
Verifies parameters and creates a newWeightedRankerinstance.- Returns:
WeightedRanker- Throws:
ParamException
-
-