Description
Currently, when using cosine similarity with Faiss Engine, OpenSearch/k-NN does not return the original non-normalized vectors with Derived Source Enabled. Since we normalize the vectors before storing them to avoid doing normalization at every distance computation phase(segment flush, merges, search query).
Due to this limitation a user who needs original vectors for re-ranking or any other purpose has to do either of this:
- Store vectors outside of OpenSearch too.
- Store the norm with the document and then reconstruct vectors at the final step using script score(which is very slow) to recover original vectors, resulting in overheads.
Request:
Add the ability to store the norm of the vector along side flat vectors and then return the original vector in derived source eliminating the need for the workarounds
Description
Currently, when using cosine similarity with Faiss Engine, OpenSearch/k-NN does not return the original non-normalized vectors with Derived Source Enabled. Since we normalize the vectors before storing them to avoid doing normalization at every distance computation phase(segment flush, merges, search query).
Due to this limitation a user who needs original vectors for re-ranking or any other purpose has to do either of this:
Request:
Add the ability to store the norm of the vector along side flat vectors and then return the original vector in derived source eliminating the need for the workarounds