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 java.lang.Object
Builder forWeightedRanker
class.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WeightedRanker
build()
Verifies parameters and creates a newWeightedRanker
instance.WeightedRanker.Builder
withWeights(@NonNull java.util.List<java.lang.Float> weights)
Assign weights for each AnnSearchParam.
-
-
-
Method Detail
-
withWeights
public WeightedRanker.Builder withWeights(@NonNull @NonNull java.util.List<java.lang.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 newWeightedRanker
instance.- Returns:
WeightedRanker
- Throws:
ParamException
-
-