Class TableVectorIndexDefinition
java.lang.Object
com.datastax.astra.client.tables.definition.indexes.TableIndexDefinition<TableVectorIndexDefinitionOptions>
com.datastax.astra.client.tables.definition.indexes.TableVectorIndexDefinition
public class TableVectorIndexDefinition
extends TableIndexDefinition<TableVectorIndexDefinitionOptions>
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
FieldsModifier 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.TableIndexDefinition
apiSupport, column, constructor, options
-
Constructor Summary
ConstructorsModifierConstructorDescriptionConstructs a newTableVectorIndexDefinition
instance.protected
Constructs a newTableVectorIndexDefinition
instance with the specified options. -
Method Summary
Modifier and TypeMethodDescriptionSets the name of the column for the index.column
(String column, TableIndexMapTypes type) Sets the name of the column for the index.metric
(SimilarityMetric metric) Configures the similarity metric to be used for the vector index.options
(TableVectorIndexDefinitionOptions options) Sets the options for configuring the table index.sourceModel
(String sourceModel) Sets the source model for the vector index.Methods inherited from class com.datastax.astra.client.tables.definition.indexes.TableIndexDefinition
mapImpl
-
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. -
TableVectorIndexDefinition
Constructs a newTableVectorIndexDefinition
instance with the specified options.- Parameters:
options
- the options to use for the vector index.
-
-
Method Details
-
column
Description copied from class:TableIndexDefinition
Sets the name of the column for the index.- Overrides:
column
in classTableIndexDefinition<TableVectorIndexDefinitionOptions>
- Parameters:
column
- the name of the column to be indexed.- Returns:
- a new instance with the updated column.
-
column
Description copied from class:TableIndexDefinition
Sets the name of the column for the index.- Overrides:
column
in classTableIndexDefinition<TableVectorIndexDefinitionOptions>
- Parameters:
column
- the name of the column to be indexed.type
- the type of the column to be indexed.- Returns:
- the current instance of
TableIndexDefinition
for method chaining.
-
options
Description copied from class:TableIndexDefinition
Sets the options for configuring the table index.- Overrides:
options
in classTableIndexDefinition<TableVectorIndexDefinitionOptions>
- Parameters:
options
- an instance ofTableIndexDefinitionOptions
containing index options.- Returns:
- the current instance of
TableIndexDefinition
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.
-