Enum Class CouchbaseSimilarityFunction

java.lang.Object
java.lang.Enum<CouchbaseSimilarityFunction>
org.springframework.ai.vectorstore.CouchbaseSimilarityFunction
All Implemented Interfaces:
Serializable, Comparable<CouchbaseSimilarityFunction>, Constable

public enum CouchbaseSimilarityFunction extends Enum<CouchbaseSimilarityFunction>
Choose the method to calculate the similarity between the vector embedding in a Vector Search index and the vector embedding in a Vector Search query. See https://docs.couchbase.com/server/current/search/child-field-options-reference.html for more details.
Since:
1.0.0
Author:
Laurent Doguin
  • Enum Constant Details

    • l2_norm

      public static final CouchbaseSimilarityFunction l2_norm
      It’s best to use l2_norm similarity when your embeddings contain information about the count or measure of specific things, and your embedding model uses the same similarity metric.
    • dot_product

      public static final CouchbaseSimilarityFunction dot_product
      Dot product similarity is commonly used by Large Language Models (LLMs). Use dot_product to get the best results with an embedding model that uses dot product similarity.
  • Method Details

    • values

      public static CouchbaseSimilarityFunction[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CouchbaseSimilarityFunction valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null