RRFRanker
The RRFRanker class extends from the Function class and provides extra parameters.
public class RRFRanker extends CreateCollectionReq.Function
Request Syntax
RRFRanker.builder()
.name(String name)
.description(String description)
.params(Map<String, String> params)
.k(int k)
.build()
BUILDER METHODS:
-
name(String name)The name of the function. This identifier is used to reference the function within queries and collections.
-
description(String description)A brief description of the function's purpose. This can be useful for documentation or clarity in larger projects and defaults to an empty string.
-
params(Map<String, String> params)A set of key-value pairs that configures the function properties.
-
k(int k)A smoothing parameter that controls the impact of document ranks; higher
kreduces sensitivity to top ranks. The value ranges from1to16383and defaults to60.
RETURN TYPE:
RRFRanker
RETURNS:
A RRF ranker instance.
Examples:
import io.milvus.v2.service.collection.request.CreateCollectionReq.Function;
import io.milvus.v2.service.vector.request.ranker.RRFRanker;
import java.util.Collections;
// use the RRFRanker class
RRFRanker.builder()
.k(60)
.build());
// Instead, you can use the Function class as well
CreateCollectionReq.Function rr = CreateCollectionReq.Function.builder()
.functionType(FunctionType.RERANK)
.param("strategy", "rrf")
.param("params", "{\"k\": 60}")
.build();