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 StringInitial source model.static final StringInitial source model.static final StringInitial source model.static final StringInitial source model.static final StringInitial source model.static final StringInitial source model.static final StringInitial source model.Fields inherited from class com.datastax.astra.client.tables.definition.indexes.TableIndexDefinition
apiSupport, column, constructor, options -
Constructor Summary
ConstructorsModifierConstructorDescriptionConstructs a newTableVectorIndexDefinitioninstance.protectedConstructs a newTableVectorIndexDefinitioninstance 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 newTableVectorIndexDefinitioninstance. -
TableVectorIndexDefinition
Constructs a newTableVectorIndexDefinitioninstance with the specified options.- Parameters:
options- the options to use for the vector index.
-
-
Method Details
-
column
Description copied from class:TableIndexDefinitionSets the name of the column for the index.- Overrides:
columnin 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:TableIndexDefinitionSets the name of the column for the index.- Overrides:
columnin 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
TableIndexDefinitionfor method chaining.
-
options
Description copied from class:TableIndexDefinitionSets the options for configuring the table index.- Overrides:
optionsin classTableIndexDefinition<TableVectorIndexDefinitionOptions>- Parameters:
options- an instance ofTableIndexDefinitionOptionscontaining index options.- Returns:
- the current instance of
TableIndexDefinitionfor method chaining.
-
metric
Configures the similarity metric to be used for the vector index.- Parameters:
metric- an instance ofSimilarityMetricrepresenting the similarity metric.- Returns:
- the current instance of
TableVectorIndexDefinitionfor 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
TableVectorIndexDefinitionfor method chaining.
-