- OpenBaselineStack 用目标库解析出的 profile 校验 schema(134 合法), contract.WeKnoraVersion 取 profile 值 - no-gate 维护参数(IngressMode/IngressAck/HealthURL)从配置透传, 否则 0.9.0 目标会被当成缺闸门拒绝 - 索引写入与校验按 profile 决定是否补 tenant_id(0.9.0 索引无该字段)
This commit is contained in:
@@ -44,6 +44,9 @@ type Profile struct {
|
||||
// IndexContractSource 说明该版本的索引名从哪里读。空值等于"读不到",
|
||||
// 不允许回退成空串去匹配任何索引。
|
||||
IndexContractSource string
|
||||
// IndexTenantField 表示该版本的索引文档带 tenant_id。0.9.0 的分块文档只有
|
||||
// knowledge_base_id,写索引时补 tenant_id 会与目标实际文档不一致。
|
||||
IndexTenantField bool
|
||||
}
|
||||
|
||||
var profiles = map[int]Profile{
|
||||
@@ -78,6 +81,7 @@ var profiles = map[int]Profile{
|
||||
{"index", "chunks"},
|
||||
},
|
||||
IndexContractSource: "vector_stores.index_config.index_name",
|
||||
IndexTenantField: true,
|
||||
},
|
||||
V090Version: {
|
||||
Name: "v090",
|
||||
@@ -122,6 +126,7 @@ var profiles = map[int]Profile{
|
||||
`CREATE TRIGGER trg_chunk_images_update AFTER UPDATE ON public.chunks FOR EACH ROW WHEN ((((old.image_info ~~ '[%'::text) OR (new.image_info ~~ '[%'::text)) AND ((old.image_info IS DISTINCT FROM new.image_info) OR (old.is_enabled IS DISTINCT FROM new.is_enabled) OR (old.status IS DISTINCT FROM new.status) OR (old.deleted_at IS DISTINCT FROM new.deleted_at) OR (old.tenant_id IS DISTINCT FROM new.tenant_id) OR ((old.knowledge_base_id)::text IS DISTINCT FROM (new.knowledge_base_id)::text) OR ((old.knowledge_id)::text IS DISTINCT FROM (new.knowledge_id)::text) OR ((old.chunk_type)::text IS DISTINCT FROM (new.chunk_type)::text) OR (old.created_at IS DISTINCT FROM new.created_at) OR (old.updated_at IS DISTINCT FROM new.updated_at)))) EXECUTE FUNCTION chunk_images_sync()`,
|
||||
},
|
||||
IndexContractSource: "config ELASTICSEARCH_INDEX",
|
||||
IndexTenantField: false,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user