Skip to content

OpenSearch changed cosine similarity score in 2.19 #4765

@quachc

Description

@quachc

I guess this is just a heads-up, because I spend a couple hours searching before I found the cause.
OpenSearch changed the formula to calculate cosine similarity in version 2.19, apparently they didn't realize this was a breaking change when you use minScore.

opensearch-project/k-NN#2357
opensearch-project/k-NN#2561

So, as of 2.19 it's not required anymore to add a 0.5 boost to the script_score query...
Not sure if it's the same for 3.x... sadly I'm stuck on 2.x, because of the infra guys :)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions