Class TableVectorIndexDefinition
java.lang.Object
com.datastax.astra.client.tables.definition.indexes.TableBaseIndexDefinition
com.datastax.astra.client.tables.definition.indexes.TableVectorIndexDefinition
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 Summary
Modifier and TypeFieldDescriptionstatic final String
Initial source model.static final String
Initial source model.static final String
Initial source model.static final String
Initial source model.static final String
Initial source model.static final String
Initial source model.static final String
Initial source model.Fields inherited from class com.datastax.astra.client.tables.definition.indexes.TableBaseIndexDefinition
apiSupport, column
-
Constructor Summary
ConstructorDescriptionConstructs a newTableVectorIndexDefinition
instance. -
Method Summary
Modifier and TypeMethodDescriptionSets the name of the column for the vector index.metric
(SimilarityMetric metric) Configures the similarity metric to be used for the vector index.options
(TableVectorIndexDefinitionOptions options) Configures the options for the vector index.sourceModel
(String sourceModel) Sets the source model for the vector index.
-
Field Details
-
SOURCE_MODEL_ADA002
Initial source model.- See Also:
-
SOURCE_MODEL_BERT
Initial source model.- See Also:
-
SOURCE_MODEL_COHERE_V3
Initial source model.- See Also:
-
SOURCE_MODEL_GECKO
Initial source model.- See Also:
-
SOURCE_MODEL_NV_QA_4
Initial source model.- See Also:
-
SOURCE_MODEL_OPENAI_V3_LARGE
Initial source model.- See Also:
-
SOURCE_MODEL_OPENAI_V3_SMALL
Initial source model.- See Also:
-
-
Constructor Details
-
TableVectorIndexDefinition
public TableVectorIndexDefinition()Constructs a newTableVectorIndexDefinition
instance.
-
-
Method Details
-
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 ofSimilarityMetric
representing the similarity metric.- Returns:
- the current instance of
TableVectorIndexDefinition
for method chaining.
-
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 ofTableVectorIndexDefinitionOptions
containing vector index options.- Returns:
- the current instance of
TableVectorIndexDefinition
for method chaining.
-