Annotation Interface DataApiCollection


@Target(TYPE) @Retention(RUNTIME) public @interface DataApiCollection
Annotation to define a collection and its configuration options.

This annotation allows you to specify collection-level settings including:

  • Collection name
  • Default ID type
  • Indexing options (allow/deny lists)
  • Vector configuration (dimension, similarity metric)
  • Vectorization service settings
  • Lexical search configuration
  • Reranking service settings

Example usage:

 
 @DataApiCollection(
     value = "my_collection",
     defaultIdType = CollectionDefaultIdTypes.UUID,
     vectorDimension = 1536,
     vectorSimilarity = SimilarityMetric.COSINE,
     indexingDeny = {"internal_field", "temp_data"}
 )
 public class MyDocument {
     @DocumentId
     private String id;
     // ... other fields
 }
 
 
  • Element Details

    • name

      String name
      Collection name. If not provided, the class name (lowercase) will be used.
      Returns:
      the collection name
      Default:
      ""
    • defaultIdType

      String defaultIdType
      The default ID type for documents in this collection. Defaults to UNDEFINED (no default ID type specified).
      Returns:
      the default ID type
      Default:
      ""
    • indexingDeny

      String[] indexingDeny
      List of field names to exclude from indexing. Mutually exclusive with indexingAllow().
      Returns:
      array of field names to deny indexing
      Default:
      {}
    • indexingAllow

      String[] indexingAllow
      List of field names to include in indexing (only these will be indexed). Mutually exclusive with indexingDeny().
      Returns:
      array of field names to allow indexing
      Default:
      {}
    • vectorDimension

      int vectorDimension
      Vector dimension size. Must be greater than 0 to enable vector search. Default is -1 (no vector configuration).
      Returns:
      the vector dimension
      Default:
      -1
    • vectorSimilarity

      SimilarityMetric vectorSimilarity
      Similarity metric for vector search. Only used when vectorDimension() is specified.
      Returns:
      the similarity metric
      Default:
      COSINE
    • vectorizeProvider

      String vectorizeProvider
      Vectorization service provider (e.g., "openai", "huggingface"). When specified, enables automatic vectorization.
      Returns:
      the vectorization provider
      Default:
      ""
    • vectorizeModel

      String vectorizeModel
      Vectorization model name (e.g., "text-embedding-ada-002"). Required when vectorizeProvider() is specified.
      Returns:
      the model name
      Default:
      ""
    • vectorizeSharedSecret

      String vectorizeSharedSecret
      Shared secret key name for vectorization service authentication. Optional, used when the provider requires authentication.
      Returns:
      the shared secret key name
      Default:
      ""
    • lexicalEnabled

      boolean lexicalEnabled
      Enable or disable lexical search for this collection. Default is true (enabled).
      Returns:
      true to enable lexical search, false to disable
      Default:
      false
    • lexicalAnalyzer

      AnalyzerTypes lexicalAnalyzer
      Analyzer type for lexical search. Only used when lexicalEnabled() is true.
      Returns:
      the analyzer type
      Default:
      STANDARD
    • rerankEnabled

      boolean rerankEnabled
      Enable or disable reranking for this collection. Default is false (disabled).
      Returns:
      true to enable reranking, false to disable
      Default:
      false
    • rerankProvider

      String rerankProvider
      Reranking service provider (e.g., "cohere"). Required when rerankEnabled() is true.
      Returns:
      the reranking provider
      Default:
      ""
    • rerankModel

      String rerankModel
      Reranking model name (e.g., "rerank-english-v2.0"). Required when rerankEnabled() is true.
      Returns:
      the reranking model name
      Default:
      ""