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
    根据配置决定哪些字段实际写入数据(未配置的字段写空数组)
    
    =
    tangwang
     
  • query config/ranking config优化
    tangwang
     

13 Nov, 2025

3 commits


11 Nov, 2025

2 commits

  • tangwang
     
  • ## 🎯 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>
    tangwang