Skip to content

[BUG] FT.SEARCH does not apply substituted AS alias to score_as in vector queries #1089

@bandalgomsu

Description

@bandalgomsu

Describe the bug

FT.SEARCH does not fully apply parameter substitution for the AS clause in vector queries.

When AS uses a substituted parameter such as $alias, the substitution is applied to a parse-time field, but the resolved value is not propagated to the final score_as field used later in execution.

As a result, the literal parameter reference may be preserved instead of the substituted alias.

To Reproduce
Run a vector query where the score alias is parameterized:

FT.SEARCH idx "*=>[KNN 10 @vec $BLOB AS $ALIAS]" PARAMS 4 BLOB <binary-vector> ALIAS my_score DIALECT 2

Observe that the returned score field alias may remain $ALIAS instead of my_score.

Expected behavior

The AS clause should honor parameter substitution in the same way as other vector-query parameters.
For the example above, the final score field alias should be my_score, not the literal $ALIAS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions