Index
- Implements: IIndex
This class encapsulates and extends the ROS resource type ALIYUN::Bailian::Index.
Initializers
import com.aliyun.ros.cdk.bailian.Index;
Index.Builder.create(Construct scope, java.lang.String id, java.lang.Boolean enableResourcePropertyConstraint)
.name(java.lang.String)
.name(IResolvable)
.sourceType(java.lang.String)
.sourceType(IResolvable)
.structureType(java.lang.String)
.structureType(IResolvable)
.workspaceId(java.lang.String)
.workspaceId(IResolvable)
// .categoryIds(IResolvable)
// .categoryIds(java.util.List<java.lang.String)
// .categoryIds(IResolvable>)
// .chunkMode(java.lang.String)
// .chunkMode(IResolvable)
// .chunkSize(java.lang.Number)
// .chunkSize(IResolvable)
// .connectId(java.lang.String)
// .connectId(IResolvable)
// .database(java.lang.String)
// .database(IResolvable)
// .denseSimilarityTopK(java.lang.Number)
// .denseSimilarityTopK(IResolvable)
// .description(java.lang.String)
// .description(IResolvable)
// .documentIds(IResolvable)
// .documentIds(java.util.List<java.lang.String)
// .documentIds(IResolvable>)
// .embeddingModelName(java.lang.String)
// .embeddingModelName(IResolvable)
// .enableHeaders(java.lang.Boolean)
// .enableHeaders(IResolvable)
// .enableRewrite(java.lang.Boolean)
// .enableRewrite(IResolvable)
// .knowledgeScene(java.lang.String)
// .knowledgeScene(IResolvable)
// .knowledgeType(java.lang.String)
// .knowledgeType(IResolvable)
// .metaExtractColumns(IResolvable)
// .metaExtractColumns(java.util.List<IResolvable)
// .metaExtractColumns(MetaExtractColumnsProperty>)
// .overlapSize(java.lang.Number)
// .overlapSize(IResolvable)
// .pipelineCommercialCu(java.lang.Number)
// .pipelineCommercialCu(IResolvable)
// .pipelineCommercialType(java.lang.String)
// .pipelineCommercialType(IResolvable)
// .pipelineRetrieveRateLimitStrategy(java.lang.String)
// .pipelineRetrieveRateLimitStrategy(IResolvable)
// .rerankInstruct(java.lang.String)
// .rerankInstruct(IResolvable)
// .rerankMinScore(java.lang.Number)
// .rerankMinScore(IResolvable)
// .rerankMode(java.lang.String)
// .rerankMode(IResolvable)
// .rerankModelName(java.lang.String)
// .rerankModelName(IResolvable)
// .separator(java.lang.String)
// .separator(IResolvable)
// .sinkInstanceId(java.lang.String)
// .sinkInstanceId(IResolvable)
// .sinkRegion(java.lang.String)
// .sinkRegion(IResolvable)
// .sinkType(java.lang.String)
// .sinkType(IResolvable)
// .sparseSimilarityTopK(java.lang.Number)
// .sparseSimilarityTopK(IResolvable)
// .table(java.lang.String)
// .table(IResolvable)
// .tableIds(IResolvable)
// .tableIds(java.util.List<java.lang.String)
// .tableIds(IResolvable>)
.build();
| Name | Type | Description |
|---|---|---|
scope | com.aliyun.ros.cdk.core.Construct | No description. |
id | java.lang.String | No description. |
enableResourcePropertyConstraint | java.lang.Boolean | No description. |
name | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property name: Knowledge base name. |
sourceType | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property sourceType: Data source type. |
structureType | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property structureType: Knowledge base type. |
workspaceId | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property workspaceId: Workspace ID. |
categoryIds | com.aliyun.ros.cdk.core.IResolvable OR java.util.List | Property categoryIds: Category IDs to import when creating the knowledge base. |
chunkMode | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property chunkMode: Chunk strategy. |
chunkSize | java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable | Property chunkSize: Chunk size, the maximum number of characters per text slice. |
connectId | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property connectId: Connection ID. |
database | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property database: Database name for structured knowledge base. |
denseSimilarityTopK | java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable | Property denseSimilarityTopK: Vector retrieval Top K. |
description | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property description: Knowledge base description. |
documentIds | com.aliyun.ros.cdk.core.IResolvable OR java.util.List | Property documentIds: Document IDs to import when creating the knowledge base. |
embeddingModelName | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property embeddingModelName: Embedding model used by the knowledge base. |
enableHeaders | java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable | Property enableHeaders: Whether to enable headers for document parsing. |
enableRewrite | java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable | Property enableRewrite: Whether to enable multi-turn dialogue rewriting. |
knowledgeScene | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property knowledgeScene: Knowledge base scene. |
knowledgeType | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property knowledgeType: Knowledge base type classification. |
metaExtractColumns | com.aliyun.ros.cdk.core.IResolvable OR java.util.List | Property metaExtractColumns: Metadata extraction configuration. |
overlapSize | java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable | Property overlapSize: Overlap size, the number of overlapping characters between adjacent text slices. |
pipelineCommercialCu | java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable | Property pipelineCommercialCu: RCU count for enterprise edition. |
pipelineCommercialType | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property pipelineCommercialType: Knowledge base specification type. |
pipelineRetrieveRateLimitStrategy | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property pipelineRetrieveRateLimitStrategy: Retrieval rate limit strategy for enterprise edition. |
rerankInstruct | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property rerankInstruct: Custom rerank instruction. |
rerankMinScore | java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable | Property rerankMinScore: Similarity threshold. |
rerankMode | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property rerankMode: Rerank mode. |
rerankModelName | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property rerankModelName: Rerank model used by the knowledge base. |
separator | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property separator: Separator for chunking. |
sinkInstanceId | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property sinkInstanceId: Vector storage instance ID. |
sinkRegion | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property sinkRegion: Region of the vector storage instance. |
sinkType | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property sinkType: Vector storage type. |
sparseSimilarityTopK | java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable | Property sparseSimilarityTopK: Keyword retrieval Top K. |
table | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property table: Table name for structured knowledge base. |
tableIds | com.aliyun.ros.cdk.core.IResolvable OR java.util.List | Property tableIds: Table IDs to import when creating the knowledge base. |
scopeRequired
- Type: com.aliyun.ros.cdk.core.Construct
idRequired
- Type: java.lang.String
enableResourcePropertyConstraintOptional
- Type: java.lang.Boolean
nameRequired
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property name: Knowledge base name.
1-20 characters. Supports Chinese, English, numbers, underscores (_), hyphens (-), periods (.) and colons (:).
sourceTypeRequired
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property sourceType: Data source type.
DATA_CENTER_CATEGORY: import files from specified categories. DATA_CENTER_FILE: import specified files.
structureTypeRequired
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property structureType: Knowledge base type.
unstructured: document search or audio/video knowledge base. structured: data query or image Q&A knowledge base.
workspaceIdRequired
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property workspaceId: Workspace ID.
The knowledge base will be created in this workspace.
categoryIdsOptional
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List
Property categoryIds: Category IDs to import when creating the knowledge base.
Required when SourceType is DATA_CENTER_CATEGORY.
chunkModeOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property chunkMode: Chunk strategy.
If not specified, smart chunking is used. When set to regex, Separator must also be provided.
chunkSizeOptional
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
Property chunkSize: Chunk size, the maximum number of characters per text slice.
Range [1-6000]. Defaults to 500. If ChunkSize is less than 100, OverlapSize must also be set.
connectIdOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property connectId: Connection ID.
Replaces the deprecated datasourceCode parameter.
databaseOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property database: Database name for structured knowledge base.
denseSimilarityTopKOptional
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
Property denseSimilarityTopK: Vector retrieval Top K.
Retrieves the K most similar text slices by vector similarity. Range [0-100]. Defaults to 100. DenseSimilarityTopK + SparseSimilarityTopK must be <= 200. Only supported in UpdateIndex, not in CreateIndex.
descriptionOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property description: Knowledge base description.
0-1000 characters.
documentIdsOptional
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List
Property documentIds: Document IDs to import when creating the knowledge base.
Required when SourceType is DATA_CENTER_FILE.
embeddingModelNameOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property embeddingModelName: Embedding model used by the knowledge base.
Defaults to text-embedding-v3.
enableHeadersOptional
- Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable
Property enableHeaders: Whether to enable headers for document parsing.
Defaults to false.
enableRewriteOptional
- Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable
Property enableRewrite: Whether to enable multi-turn dialogue rewriting.
Defaults to true.
knowledgeSceneOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property knowledgeScene: Knowledge base scene.
Must be provided together with KnowledgeType. The valid values depend on KnowledgeType.
knowledgeTypeOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property knowledgeType: Knowledge base type classification.
Must be provided together with KnowledgeScene. If both are omitted, the system uses default based on StructureType.
metaExtractColumnsOptional
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List
MetaExtractColumnsProperty>
Property metaExtractColumns: Metadata extraction configuration.
overlapSizeOptional
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
Property overlapSize: Overlap size, the number of overlapping characters between adjacent text slices.
Range [0-1024]. Defaults to 100. Must be less than ChunkSize.
pipelineCommercialCuOptional
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
Property pipelineCommercialCu: RCU count for enterprise edition.
Only required when PipelineCommercialType is enterprise. Range [1-200].
pipelineCommercialTypeOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property pipelineCommercialType: Knowledge base specification type.
standard: Standard edition. enterprise: Enterprise edition. Defaults to standard.
pipelineRetrieveRateLimitStrategyOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property pipelineRetrieveRateLimitStrategy: Retrieval rate limit strategy for enterprise edition.
Defaults to downgrade.
rerankInstructOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property rerankInstruct: Custom rerank instruction.
Required when RerankMode is custom.
rerankMinScoreOptional
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
Property rerankMinScore: Similarity threshold.
Only text slices with similarity score exceeding this value will be recalled. Range [0.01-1.00]. Defaults to 0.01.
rerankModeOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property rerankMode: Rerank mode.
qa: Q&A scenario (default). similar: similarity scenario. custom: custom rerank instruction, requires RerankInstruct.
rerankModelNameOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property rerankModelName: Rerank model used by the knowledge base.
Defaults to qwen3-rerank when not specified.
separatorOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property separator: Separator for chunking.
Only effective when ChunkMode is regex.
sinkInstanceIdOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property sinkInstanceId: Vector storage instance ID.
Required when SinkType is ADB.
sinkRegionOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property sinkRegion: Region of the vector storage instance.
Required when SinkType is ADB.
sinkTypeOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property sinkType: Vector storage type.
BUILT_IN: managed by Bailian platform. ADB: AnalyticDB for PostgreSQL. Defaults to BUILT_IN. When set to ADB, SinkInstanceId and SinkRegion are required.
sparseSimilarityTopKOptional
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
Property sparseSimilarityTopK: Keyword retrieval Top K.
Retrieves text slices by exact keyword matching. Range [0-100]. Defaults to 100. DenseSimilarityTopK + SparseSimilarityTopK must be <= 200. Only supported in UpdateIndex, not in CreateIndex.
tableOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property table: Table name for structured knowledge base.
tableIdsOptional
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List
Property tableIds: Table IDs to import when creating the knowledge base.
Methods
| Name | Description |
|---|---|
toString | Returns a string representation of this construct. |
synthesize | Allows this construct to emit artifacts into the cloud assembly during synthesis. |
addCondition | No description. |
addCount | No description. |
addDependency | No description. |
addResourceDesc | No description. |
applyRemovalPolicy | No description. |
fetchCondition | No description. |
fetchDependency | No description. |
fetchResourceDesc | No description. |
getAtt | No description. |
setMetadata | No description. |
toString
public java.lang.String toString()
Returns a string representation of this construct.
synthesize
public void synthesize(ISynthesisSession session)
Allows this construct to emit artifacts into the cloud assembly during synthesis.
This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.
- Type: com.aliyun.ros.cdk.core.ISynthesisSession
The synthesis session.
addCondition
public void addCondition(RosCondition condition)
- Type: com.aliyun.ros.cdk.core.RosCondition
addCount
public void addCount(java.lang.Number OR IResolvable count)
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
addDependency
public void addDependency(Resource resource)
- Type: com.aliyun.ros.cdk.core.Resource
addResourceDesc
public void addResourceDesc(java.lang.String desc)
- Type: java.lang.String
applyRemovalPolicy
public void applyRemovalPolicy(RemovalPolicy policy)
- Type: com.aliyun.ros.cdk.core.RemovalPolicy
fetchCondition
public RosCondition fetchCondition()
fetchDependency
public java.util.List<java.lang.String> fetchDependency()
fetchResourceDesc
public java.lang.String fetchResourceDesc()
getAtt
public IResolvable getAtt(java.lang.String name)
- Type: java.lang.String
setMetadata
public void setMetadata(java.lang.String key, java.lang.Object value)
- Type: java.lang.String
- Type: java.lang.Object
Static Functions
| Name | Description |
|---|---|
isConstruct | Return whether the given object is a Construct. |
isConstruct
import com.aliyun.ros.cdk.bailian.Index;
Index.isConstruct(java.lang.Object x)
Return whether the given object is a Construct.
- Type: java.lang.Object
Properties
| Name | Type | Description |
|---|---|---|
node | com.aliyun.ros.cdk.core.ConstructNode | The construct tree node associated with this construct. |
env | com.aliyun.ros.cdk.core.IResourceEnvironment | The environment this resource belongs to. |
ref | java.lang.String | No description. |
stack | com.aliyun.ros.cdk.core.Stack | The stack in which this resource is defined. |
resource | com.aliyun.ros.cdk.core.RosResource | No description. |
attrId | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute Id: The unique ID of the knowledge base index. |
props | IndexProps | No description. |
nodeRequired
public ConstructNode getNode();
- Type: com.aliyun.ros.cdk.core.ConstructNode
The construct tree node associated with this construct.
envRequired
public IResourceEnvironment getEnv();
- Type: com.aliyun.ros.cdk.core.IResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
refRequired
public java.lang.String getRef();
- Type: java.lang.String
stackRequired
public Stack getStack();
- Type: com.aliyun.ros.cdk.core.Stack
The stack in which this resource is defined.
resourceOptional
public RosResource getResource();
- Type: com.aliyun.ros.cdk.core.RosResource
attrIdRequired
public java.lang.Object getAttrId();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute Id: The unique ID of the knowledge base index.
propsRequired
public IndexProps getProps();
- Type: IndexProps