跳到主要内容
版本:v3.0.x

FunctionChainExpr

A function invocation expression used by a function-chain operation, such as num_combine, decay, or round_decimal.

Java
io.milvus.v2.service.vector.request.FunctionChainExpr

Constructor​

This builder creates a function expression with a name, arguments, and named parameters.

Java
FunctionChainExpr.builder()
.name(String name)
.arg(FunctionChainArg arg)
.param(String key, Object value)
.build()

BUILDER METHODS:

  • name(String name)

    The expression name, e.g. "num_combine".

  • arg(FunctionChainArg arg)

    Appends an argument, which can be a column reference or a literal. See FunctionChainArg.

  • param(String key, Object value)

    Sets a named parameter of the expression.

RETURN TYPE:

FunctionChainExpr

METHODS:

  • String getName()

    Returns the expression name.

  • List<FunctionChainArg> getArgs()

    Returns the expression arguments.

  • Map<String, FunctionParamValue> getParams()

    Returns the named parameters of the expression.

Example​

Java
FunctionChainExpr expr = FunctionChainExpr.builder()
.name("num_combine")
.arg(FunctionChainArg.col("$score"))
.arg(FunctionChainArg.col("freshness"))
.param("mode", "weighted")
.build();