Annotation 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
}
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe default ID type for documents in this collection.String[]List of field names to include in indexing (only these will be indexed).String[]List of field names to exclude from indexing.Analyzer type for lexical search.booleanEnable or disable lexical search for this collection.Collection name.booleanEnable or disable reranking for this collection.Reranking model name (e.g., "rerank-english-v2.0").Reranking service provider (e.g., "cohere").intVector dimension size.Vectorization model name (e.g., "text-embedding-ada-002").Vectorization service provider (e.g., "openai", "huggingface").Shared secret key name for vectorization service authentication.Similarity metric for vector search.
-
Element Details
-
name
String nameCollection name. If not provided, the class name (lowercase) will be used.- Returns:
- the collection name
- Default:
""
-
defaultIdType
String defaultIdTypeThe default ID type for documents in this collection. Defaults to UNDEFINED (no default ID type specified).- Returns:
- the default ID type
- Default:
""
-
indexingDeny
String[] indexingDenyList of field names to exclude from indexing. Mutually exclusive withindexingAllow().- Returns:
- array of field names to deny indexing
- Default:
{}
-
indexingAllow
String[] indexingAllowList of field names to include in indexing (only these will be indexed). Mutually exclusive withindexingDeny().- Returns:
- array of field names to allow indexing
- Default:
{}
-
vectorDimension
int vectorDimensionVector 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 vectorSimilaritySimilarity metric for vector search. Only used whenvectorDimension()is specified.- Returns:
- the similarity metric
- Default:
COSINE
-
vectorizeProvider
String vectorizeProviderVectorization service provider (e.g., "openai", "huggingface"). When specified, enables automatic vectorization.- Returns:
- the vectorization provider
- Default:
""
-
vectorizeModel
String vectorizeModelVectorization model name (e.g., "text-embedding-ada-002"). Required whenvectorizeProvider()is specified.- Returns:
- the model name
- Default:
""
-
lexicalEnabled
boolean lexicalEnabledEnable or disable lexical search for this collection. Default is true (enabled).- Returns:
- true to enable lexical search, false to disable
- Default:
false
-
lexicalAnalyzer
AnalyzerTypes lexicalAnalyzerAnalyzer type for lexical search. Only used whenlexicalEnabled()is true.- Returns:
- the analyzer type
- Default:
STANDARD
-
rerankEnabled
boolean rerankEnabledEnable or disable reranking for this collection. Default is false (disabled).- Returns:
- true to enable reranking, false to disable
- Default:
false
-
rerankProvider
String rerankProviderReranking service provider (e.g., "cohere"). Required whenrerankEnabled()is true.- Returns:
- the reranking provider
- Default:
""
-
rerankModel
String rerankModelReranking model name (e.g., "rerank-english-v2.0"). Required whenrerankEnabled()is true.- Returns:
- the reranking model name
- Default:
""
-