v.22.12Experimental Feature

Add Cosine Distance Support to Experimental Annoy Index

Add support for cosine distance for the experimental Annoy (vector similarity search) index. #42778 (Filatenkov Artur).
Add support for cosine distance metric in the experimental Annoy index used for vector similarity search in ClickHouse.

Why it matters

This feature enables users to perform vector similarity searches using the cosine distance metric, which is often more appropriate for measuring similarity in high-dimensional spaces compared to other metrics. It enhances the flexibility and effectiveness of the Annoy index for various machine learning and data analysis tasks involving vectors.

How to use it

To use cosine distance in the Annoy index, specify the distance metric as cosine when creating the index. For example, set the index type and distance metric parameters accordingly during table creation or index definition to enable cosine similarity search.