Closed nekomeowww closed 1 month ago
Hi @nekomeowww,
I believe the Score
field is populated when using FT.SEARCH ... WITHSCORES
, but I am not sure if the score will be the __vec_score
in this case.
Thanks for explaining, I went to check the Score
field, it indeed returned, but with 0 as value and its value differs from __vec_score
:
I will go and check what does Score
mean and adjust my implementation, thanks.
Summary
I was doing some research on Redis and vector search capabilities for semantic cache, but I found myself lost due to the emptiness of
FtSearchDoc.Score
as0
value.When executing such command:
the
Score
field ofrecords[int]
will be zero all the time due to the (maybe missing or incorrectly handled) field parsing strategy over implementation of:https://github.com/redis/rueidis/blob/55e08314a4e11d376202acfd30e70f8012199203/message.go#L1046-L1073
I discovered this when debugging the redis messages:
As shown above, the
__vec_score
is present as child ofextra_attributes
instead ofresults
when working with vectors, which lead theScore
field to be unassigned.I haven't tested yet, but I suspect the field that indicates the score (
__vec_score
in this case) is not always in the right position for other types ofFT.SEARCH
command, therefore the parsing ofscore
underresult
is intended for other types ofFT.SEARCH
command, then this would not be an implementation issue.Proposal
AsFtSearchVector()
method for processing the vectors correctly?__vec_score
inextra_attributes
?Addition notes
For the code I provided above, I went through the:
386
413
along with the official documentation:
TBH, the documentation of
__vec_score
rarely exists, and typos.Current workaround