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 for `WeightedRanker` class.

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `WeightedRanker` | `build()` Verifies parameters and creates a new `WeightedRanker` instance.
    `WeightedRanker.Builder` | `withWeights(@NonNull java.util.List<java.lang.Float> weights)` Assign weights for each AnnSearchParam.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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