Class WeightedRanker.Builder

java.lang.Object
io.milvus.param.dml.ranker.WeightedRanker.Builder
Enclosing class:
WeightedRanker

public static class WeightedRanker.Builder extends Object
Builder for WeightedRanker class.
  • Method Details

    • 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 new WeightedRanker instance.
      Returns:
      WeightedRanker
      Throws:
      ParamException