Class WeightedRanker
- java.lang.Object
-
- io.milvus.v2.service.collection.request.CreateCollectionReq.Function
-
- io.milvus.v2.service.vector.request.ranker.WeightedRanker
-
public class WeightedRanker extends CreateCollectionReq.Function
The Average Weighted Scoring reranking strategy, which prioritizes vectors based on relevance, averaging their significance. Read the doc for more info: https://milvus.io/docs/weighted-ranker.mdNote: In v2.6, the Function and Rerank have been unified to support more rerank types: decay and model ranker https://milvus.io/docs/decay-ranker-overview.md https://milvus.io/docs/model-ranker-overview.md So we have to inherit the BaseRanker from Function, this change will lead to uncomfortable issues with RRFRanker/WeightedRanker in some users client code. We will mention it in release note. In old client code, to declare a WeightedRanker: WeightedRanker ranker = new WeightedRanker(Arrays.asList(0.2f, 0.5f, 0.6f)) After this change, the client code should be changed accordingly: WeightedRanker ranker = WeightedRanker.builder().weights(Arrays.asList(0.2f, 0.5f, 0.6f)).build()
You also can declare a weighter ranker by Function CreateCollectionReq.Function rr = CreateCollectionReq.Function.builder() .functionType(FunctionType.RERANK) .param("reranker", "weighted") .param("weights", "[0.4, 0.6]") .build();
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWeightedRanker.WeightedRankerBuilder-
Nested classes/interfaces inherited from class io.milvus.v2.service.collection.request.CreateCollectionReq.Function
CreateCollectionReq.Function.FunctionBuilder<T extends CreateCollectionReq.Function.FunctionBuilder<T>>
-
-
Constructor Summary
Constructors Constructor Description WeightedRanker(List<Float> weights)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static WeightedRanker.WeightedRankerBuilderbuilder()FunctionTypegetFunctionType()Map<String,String>getParams()List<Float>getWeights()voidsetWeights(List<Float> weights)StringtoString()-
Methods inherited from class io.milvus.v2.service.collection.request.CreateCollectionReq.Function
getDescription, getInputFieldNames, getName, getOutputFieldNames, setDescription, setFunctionType, setInputFieldNames, setName, setOutputFieldNames, setParams
-
-
-
-
Constructor Detail
-
WeightedRanker
@Deprecated public WeightedRanker(List<Float> weights)
Deprecated.
-
-
Method Detail
-
getFunctionType
public FunctionType getFunctionType()
- Overrides:
getFunctionTypein classCreateCollectionReq.Function
-
getParams
public Map<String,String> getParams()
- Overrides:
getParamsin classCreateCollectionReq.Function
-
toString
public String toString()
- Overrides:
toStringin classCreateCollectionReq.Function
-
builder
public static WeightedRanker.WeightedRankerBuilder builder()
-
-