Class CollectionDefinition

java.lang.Object
com.datastax.astra.client.collections.definition.CollectionDefinition

public class CollectionDefinition extends Object
Set of options to define and initialize a collection.
  • Constructor Details

    • CollectionDefinition

      public CollectionDefinition()
      Default constructor.
  • Method Details

    • getVector

      public VectorOptions getVector()
      Access the vector options.
      Returns:
      vector options
    • getIndexing

      Access the indexing options.
      Returns:
      indexing options
    • getDefaultId

      Gets defaultId
      Returns:
      value of defaultId
    • defaultId

      Builder pattern.
      Parameters:
      type - default id type
      Returns:
      self reference
    • vectorDimension

      public CollectionDefinition vectorDimension(int size)
      Builder pattern.
      Parameters:
      size - size
      Returns:
      self reference
    • vectorSimilarity

      public CollectionDefinition vectorSimilarity(@NonNull @NonNull SimilarityMetric metric)
      Builder pattern.
      Parameters:
      metric - similarity metric
      Returns:
      self reference
    • indexingDeny

      public CollectionDefinition indexingDeny(@NonNull @NonNull String... properties)
      Builder pattern.
      Parameters:
      properties - size
      Returns:
      self reference
    • indexingAllow

      public CollectionDefinition indexingAllow(String... properties)
      Builder pattern.
      Parameters:
      properties - size
      Returns:
      self reference
    • vector

      public CollectionDefinition vector(int dimension, @NonNull @NonNull SimilarityMetric function)
      Builder pattern.
      Parameters:
      dimension - dimension
      function - function
      Returns:
      self reference
    • vectorize

      public CollectionDefinition vectorize(String provider, String modeName)
      Enable Vectorization within the collection.
      Parameters:
      provider - provider Name (LLM)
      modeName - mode name
      Returns:
      self reference
    • vectorize

      public CollectionDefinition vectorize(String provider, String modeName, String sharedSecretKey)
      Enable Vectorization within the collection.
      Parameters:
      provider - provider Name (LLM)
      modeName - mode name
      sharedSecretKey - name of the key in the system
      Returns:
      self reference
    • vectorize

      public CollectionDefinition vectorize(String provider, String modeName, String sharedSecretKey, Map<String,Object> parameters)
      Enable Vectorization within the collection.
      Parameters:
      provider - provider Name (LLM)
      modeName - mode name
      sharedSecretKey - name of the key in the system
      parameters - expected parameters for vectorize
      Returns:
      self reference