12 Mar, 2026
3 commits
11 Mar, 2026
3 commits
10 Mar, 2026
4 commits
-
和微服务(embedding/translate/rerank)。 **新增文件** - 压测主脚本:[perf_api_benchmark.py](/data/saas-search/scripts/perf_api_benchmark.py:1) - 自定义用例模板:[perf_cases.json.example](/data/saas-search/scripts/perf_cases.json.example:1) **文档更新** - 在接口对接文档增加“接口级压测脚本”章节:[搜索API对接指南.md](/data/saas-search/docs/搜索API对接指南.md:2089) **支持的场景** - `backend_search` -> `POST /search/` - `backend_suggest` -> `GET /search/suggestions` - `embed_text` -> `POST /embed/text` - `translate` -> `POST /translate` - `rerank` -> `POST /rerank` - `all` -> 依次执行上述全部场景 **你可以直接执行的命令** 1. `./.venv/bin/python scripts/perf_api_benchmark.py --scenario backend_suggest --tenant-id 162 --duration 30 --concurrency 50` 2. `./.venv/bin/python scripts/perf_api_benchmark.py --scenario backend_search --tenant-id 162 --duration 30 --concurrency 20` 3. `./.venv/bin/python scripts/perf_api_benchmark.py --scenario all --tenant-id 162 --duration 60 --concurrency 30 --output perf_reports/all.json` 4. `./.venv/bin/python scripts/perf_api_benchmark.py --scenario all --tenant-id 162 --cases-file scripts/perf_cases.json.example --duration 60 --concurrency 40 --output perf_reports/custom_all.json` **可选参数** - `--backend-base` `--embedding-base` `--translator-base` `--reranker-base`:切到你的实际服务地址 - `--max-requests`:限制总请求数 - `--max-errors`:错误达到阈值提前停止 - `--pause`:`all` 模式下场景间暂停 **本地已验证** - `backend_suggest` 小规模并发压测成功(200,成功率 100%) - `backend_search` 小规模并发压测成功(200,成功率 100%) - `translate` 小规模并发压测成功(200,成功率 100%)
09 Mar, 2026
4 commits
-
CNCLIP_DEVICE=cuda TEI_USE_GPU=1 ./scripts/service_ctl.sh start 搜索后端+indexer+测试前段+4个微服务 跑通
08 Mar, 2026
2 commits
07 Mar, 2026
1 commit
06 Mar, 2026
1 commit
02 Mar, 2026
1 commit
05 Feb, 2026
1 commit
-
- API:新增请求参数 ai_search,开启时在窗口内走重排流程 - 配置:RerankConfig 移除 enabled/expression/description,仅保留 rerank_window 及 service_url/timeout_sec/weight_es/weight_ai;默认超时 15s - 重排流程:ai_search 且 from+size<=rerank_window 时,ES 取前 rerank_window 条, 调用外部 /rerank 服务,融合 ES 与重排分数后按 from/size 分页;否则不重排 - search/rerank_client:新增模块,封装 build_docs、call_rerank_service、 fuse_scores_and_resort、run_rerank;超时单独捕获并简短日志 - search/searcher:移除 RerankEngine,enable_rerank=ai_search,使用 config.rerank 参数 - 删除 search/rerank_engine.py(本地表达式重排),统一为外部服务一种实现 - 文档:搜索 API 对接指南补充 ai_search 与 relevance_score 说明 - 测试:conftest 中 rerank 配置改为新结构 Co-authored-by: Cursor <cursoragent@cursor.com>
06 Jan, 2026
1 commit
-
mappings/search_products.json:把原来的 title_zh/title_en/brief_zh/... 改成 按语言 key 的对象结构( /products/_doc/1 { "title": {"en":...} } ) 同时在这些字段下 预置了全部 analyzer 语言: arabic, armenian, basque, brazilian, bulgarian, catalan, chinese, cjk, czech, danish, dutch, english, finnish, french, galician, german, greek, hindi, hungarian, indonesian, italian, norwegian, persian, portuguese, romanian, russian, spanish, swedish, turkish, thai 实现为 type: object + properties,同时满足“按语言灌入”和“按语言 analyzer”。 索引灌入(全量/增量/transformer)已同步改完 indexer/document_transformer.py:输出从 title_zh/title_en/... 改为: title: {<primary_lang>: 原文, en?: 翻译, zh?: 翻译} brief/description/vendor 同理 category_path/category_name_text 也改为语言对象(避免查询侧继续依赖旧字段) indexer/incremental_service.py:embedding 取值从 title_en/title_zh 改为从 title 对象里优先取 en,否则取 zh,否则取任一可用语言。 查询侧与配置、API/文档已同步 search/es_query_builder.py:查询字段统一改成点路径:title.zh / title.en / vendor.zh / vendor.zh.keyword / category_name_text.zh 等。 config/config.yaml:field boosts / indexes 里的字段名同步为新点路径。 API & formatter: api/result_formatter.py 已支持新结构(并保留对旧 *_zh/_en 的兼容兜底)。 api/models.py、相关 docs/examples 里的 vendor_zh.keyword 等已更新为 vendor.zh.keyword。 文档/脚本:docs/、README.md、scripts/ 里所有旧字段名引用已批量替换为新结构。
31 Dec, 2025
1 commit
18 Dec, 2025
1 commit
-
config/config_loader.py: 从 QueryConfig 类中删除 enable_translation 字段 config/config.yaml: 删除 enable_translation: true 配置项 config/config_loader.py: 从 to_dict() 方法中删除相关输出 2. 索引阶段(离线)- 使用租户配置 indexer/indexing_utils.py: 根据 tenant_config.translate_to_en 和 translate_to_zh 决定是否初始化 translator 只有任一方向开启时才创建 translator indexer/document_transformer.py: _fill_text_fields 从 tenant_config 读取 translate_to_en 和 translate_to_zh 调用 translate_for_indexing 时传递这两个参数 更新了文档注释 3. 查询阶段(在线)- 使用租户配置 query/query_parser.py: parse() 方法新增 tenant_id 参数 根据租户配置决定翻译目标语言(translate_to_zh / translate_to_en) 如果两个都是 false,跳过翻译阶段 translator 属性不再依赖 enable_translation,总是可以初始化 search/searcher.py: search() 方法中根据租户配置计算 enable_translation(用于日志和 metadata) 调用 query_parser.parse() 时传递 tenant_id 4. 翻译器方法更新 query/translator.py: translate_for_indexing() 新增 translate_to_en 和 translate_to_zh 参数(默认 True 保持向后兼容) 根据这两个参数决定翻译目标 更新了文档注释
02 Dec, 2025
2 commits
-
1. 加了一个配置searchable_option_dimensions,功能是配置子sku的option1_value option2_value option3_value 哪些参与检索(进索引、以及在线搜索的时候将对应字段纳入搜索field)。格式为list,选择三者中的一个或多个。 2. 索引 @mappings/search_products.json 要加3个字段 option1_values option2_values option3_values,各自的 数据灌入(mysql->ES)的模块也要修改,这个字段是对子sku的option1_value option2_value option3_value分别提取去抽后得到的list。 searchable_option_dimensions 中配置的,才进索引,比如 searchable_option_dimensions = ['option1'] 则 只对option1提取属性值去重组织list进入索引,其余两个字段为空 3. 在线 对应的将 searchable_option_dimensions 中 对应的索引字段纳入 multi_match 的 fields,权重设为0.5 (各个字段的权重配置放到一起集中管理) 1. 配置文件改动 (config/config.yaml) ✅ 在 spu_config 中添加了 searchable_option_dimensions 配置项,默认值为 ['option1', 'option2', 'option3'] ✅ 添加了3个新字段定义:option1_values, option2_values, option3_values,类型为 KEYWORD,权重为 0.5 ✅ 在 default 索引域的 fields 列表中添加了这3个字段,使其参与搜索 2. ES索引Mapping改动 (mappings/search_products.json) ✅ 添加了3个新字段:option1_values, option2_values, option3_values,类型为 keyword 3. 配置加载器改动 (config/config_loader.py) ✅ 在 SPUConfig 类中添加了 searchable_option_dimensions 字段 ✅ 更新了配置解析逻辑,支持读取 searchable_option_dimensions ✅ 更新了配置转换为字典的逻辑 4. 数据灌入改动 (indexer/spu_transformer.py) ✅ 在初始化时加载配置,获取 searchable_option_dimensions ✅ 在 _transform_spu_to_doc 方法中添加逻辑: 从所有子SKU中提取 option1, option2, option3 值 去重后存入 option1_values, option2_values, option3_values 根据配置决定哪些字段实际写入数据(未配置的字段写空数组) =
-
query config/ranking config优化
13 Nov, 2025
3 commits
-
创建统一配置文件 config/config.yaml(从 base 配置迁移,移除 customer_name) 创建脚本体系 启动、停止、重启、moc数据到mysql、从mysql灌入数据到ES 这些脚本 restart.sh run.sh 内部调用 启动前后端 scripts/mock_data.sh mock数据 -> mysql scripts/ingest.sh mysql->ES
11 Nov, 2025
2 commits
-
## 🎯 Major Features - Request context management system for complete request visibility - Structured JSON logging with automatic daily rotation - Performance monitoring with detailed stage timing breakdowns - Query analysis result storage and intermediate result tracking - Error and warning collection with context correlation ## 🔧 Technical Improvements - **Context Management**: Request-level context with reqid/uid correlation - **Performance Monitoring**: Automatic timing for all search pipeline stages - **Structured Logging**: JSON format logs with request context injection - **Query Enhancement**: Complete query analysis tracking and storage - **Error Handling**: Enhanced error tracking with context information ## 🐛 Bug Fixes - Fixed DeepL API endpoint (paid vs free API confusion) - Fixed vector generation (GPU memory cleanup) - Fixed logger parameter passing format (reqid/uid handling) - Fixed translation and embedding functionality ## 🌟 API Improvements - Simplified API interface (8→5 parameters, 37.5% reduction) - Made internal functionality transparent to users - Added performance info to API responses - Enhanced request correlation and tracking ## 📁 New Infrastructure - Comprehensive test suite (unit, integration, API tests) - CI/CD pipeline with automated quality checks - Performance monitoring and testing tools - Documentation and example usage guides ## 🔒 Security & Reliability - Thread-safe context management for concurrent requests - Automatic log rotation and structured output - Error isolation with detailed context information - Complete request lifecycle tracking 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>