Class VectorIndexConfig

java.lang.Object
com.hazelcast.config.vector.VectorIndexConfig
All Implemented Interfaces:
NamedConfig, DataSerializable, IdentifiedDataSerializable

@Beta public class VectorIndexConfig extends Object implements NamedConfig, IdentifiedDataSerializable
Configuration for a vector index.
  • Constructor Details

    • VectorIndexConfig

      public VectorIndexConfig(String indexName, Metric metric, int dimension)
      Constructs a VectorIndexConfig with the given parameters.
      Parameters:
      indexName - the name of the index
      metric - the distance metric of the index
      dimension - the dimension of the index
      Throws:
      IllegalArgumentException - if the indexName is invalid.
      NullPointerException - if the metric is null.
    • VectorIndexConfig

      public VectorIndexConfig(String indexName, Metric metric, int dimension, int maxDegree, int efConstruction, boolean useDeduplication)
      Constructs a VectorIndexConfig object with the specified parameters.
      Parameters:
      indexName - The name of the index.
      metric - The metric used for indexing.
      dimension - The dimension of the vectors to be indexed.
      maxDegree - The maximum number of connections allowed per node.
      efConstruction - The size of the dynamic list for search.
      useDeduplication - Whether to enable deduplication in the index.
      Throws:
      IllegalArgumentException - if the indexName is invalid.
      NullPointerException - if the metric is null.
    • VectorIndexConfig

      public VectorIndexConfig()
      Constructs an empty VectorIndexConfig.
    • VectorIndexConfig

      public VectorIndexConfig(VectorIndexConfig config)
      Constructs a new VectorIndexConfig instance by copying the values from the provided configuration.
      Parameters:
      config - The VectorIndexConfig instance to copy. It serves as the source of values for the new configuration.
  • Method Details

    • getMetric

      public Metric getMetric()
      Retrieves the metric of this vector index configuration.
      Returns:
      the metric of the index
    • setMetric

      public VectorIndexConfig setMetric(Metric metric)
      Sets the metric of this vector index configuration.
      Parameters:
      metric - the metric to set
      Returns:
      this VectorIndexConfig instance
    • getDimension

      public int getDimension()
      Retrieves the dimension of this vector index configuration.
      Returns:
      the dimension of the index
    • setDimension

      public VectorIndexConfig setDimension(int dimension)
      Sets the dimension of this vector index configuration.
      Parameters:
      dimension - the dimension to set
      Returns:
      this VectorIndexConfig instance
    • getMaxDegree

      public int getMaxDegree()
      Retrieves the maximum number of connections a node can have.
      Returns:
      The maximum number of connections allowed per node.
    • setMaxDegree

      public VectorIndexConfig setMaxDegree(int maxDegree)
      Sets the maximum number of connections allowed per node.
      Parameters:
      maxDegree - The maximum degree to set.
      Returns:
      this VectorIndexConfig instance
    • getEfConstruction

      public int getEfConstruction()
      Retrieves the size of the dynamic list search to use during index time.
      Returns:
      the size of the dynamic list search.
    • setEfConstruction

      public VectorIndexConfig setEfConstruction(int efConstruction)
      Sets the size of the dynamic list search to use during index time.
      Parameters:
      efConstruction - the size of the dynamic list search.
      Returns:
      this VectorIndexConfig instance
    • isUseDeduplication

      public boolean isUseDeduplication()
      Checks if deduplication is enabled.
      Returns:
      True if deduplication is enabled, false otherwise.
    • setUseDeduplication

      public VectorIndexConfig setUseDeduplication(boolean useDeduplication)
      Enables or disables deduplication.
      Parameters:
      useDeduplication - True to enable deduplication, false to disable.
      Returns:
      this VectorIndexConfig instance
    • setName

      public VectorIndexConfig setName(String name)
      Sets the name of the vector index.
      Specified by:
      setName in interface NamedConfig
      Parameters:
      name - the name to set for this vector index.
    • getName

      public String getName()
      Returns the name of this vector index
      Specified by:
      getName in interface NamedConfig
      Returns:
      the name of the vector index
    • writeData

      public void writeData(ObjectDataOutput out) throws IOException
      Description copied from interface: DataSerializable
      Writes object fields to output stream
      Specified by:
      writeData in interface DataSerializable
      Parameters:
      out - output
      Throws:
      IOException - if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.
    • readData

      public void readData(ObjectDataInput in) throws IOException
      Description copied from interface: DataSerializable
      Reads fields from the input stream
      Specified by:
      readData in interface DataSerializable
      Parameters:
      in - input
      Throws:
      IOException - if an I/O error occurs. In particular, an IOException may be thrown if the input stream has been closed.
    • getFactoryId

      public int getFactoryId()
      Description copied from interface: IdentifiedDataSerializable
      Returns DataSerializableFactory factory ID for this class.
      Specified by:
      getFactoryId in interface IdentifiedDataSerializable
      Returns:
      factory ID
    • getClassId

      public int getClassId()
      Description copied from interface: IdentifiedDataSerializable
      Returns type identifier for this class. It should be unique per DataSerializableFactory.
      Specified by:
      getClassId in interface IdentifiedDataSerializable
      Returns:
      type ID
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object