Class TableVectorIndexDefinition

java.lang.Object
com.datastax.astra.client.tables.definition.indexes.TableBaseIndexDefinition
com.datastax.astra.client.tables.definition.indexes.TableVectorIndexDefinition

public class TableVectorIndexDefinition extends TableBaseIndexDefinition
Represents a definition for table vector indices, allowing configuration of vector-specific options such as similarity metrics and source models. This class provides a fluent interface for building vector index definitions.

Example usage:

 
 TableVectorIndexDefinition vectorIndexDefinition = new TableVectorIndexDefinition()
     .column("feature_vector")
     .metric(SimilarityMetric.COSINE)
     .sourceModel("model_name")
     .options(new TableVectorIndexDefinitionOptions());
 
 
  • Field Details

  • Constructor Details

    • TableVectorIndexDefinition

      public TableVectorIndexDefinition()
      Constructs a new TableVectorIndexDefinition instance.
  • Method Details

    • column

      public TableVectorIndexDefinition column(String column)
      Sets the name of the column for the vector index.
      Parameters:
      column - the name of the column containing vector data.
      Returns:
      the current instance of TableVectorIndexDefinition for method chaining.
    • metric

      Configures the similarity metric to be used for the vector index.
      Parameters:
      metric - an instance of SimilarityMetric representing the similarity metric.
      Returns:
      the current instance of TableVectorIndexDefinition for method chaining.
    • sourceModel

      public TableVectorIndexDefinition sourceModel(String sourceModel)
      Sets the source model for the vector index.
      Parameters:
      sourceModel - the name of the source model to be associated with the vector index.
      Returns:
      the current instance of TableVectorIndexDefinition for method chaining.
    • options

      Configures the options for the vector index.
      Parameters:
      options - an instance of TableVectorIndexDefinitionOptions containing vector index options.
      Returns:
      the current instance of TableVectorIndexDefinition for method chaining.