Enum Class Metric

java.lang.Object
java.lang.Enum<Metric>
com.hazelcast.config.vector.Metric
All Implemented Interfaces:
Serializable, Comparable<Metric>, Constable

@Beta public enum Metric extends Enum<Metric>
Vector similarity metrics: These are utilized in search algorithms to retrieve the top K most similar vectors to a target vector. This labels describes the methodology employed during indexing and searching of vectors to identify the nearest neighbors.
Since:
5.5
  • Enum Constant Details

    • EUCLIDEAN

      public static final Metric EUCLIDEAN
      Euclidean distance
    • COSINE

      public static final Metric COSINE
      Cosine distance
    • DOT

      public static final Metric DOT
      Dot product
  • Method Details

    • values

      public static Metric[] 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 Metric 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
    • getId

      public int getId()
      Gets the ID for the given Metric.
      Returns:
      the ID
    • getById

      public static Metric getById(int id)
      Returns the Metric as an enum.
      Returns:
      the Metric as an enum