11 Feb, 2026

1 commit


06 Feb, 2026

1 commit

  • ---
    
     1. `search/es_query_builder.py`:`_all` 分支
    
    - **普通字段**(如 `tags_all`, `category1_name_all`):
      - 键以 `_all` 结尾时,先去掉后缀得到 ES 字段名。
      - 若值为**数组**:生成 `bool.must`,内含多个 `term`,即多值 **AND**。
      - 若值为**单值**:生成一个 `term`。
    - **specifications_all**:
      - 值为 `[{name, value}, ...]` 时,为每一项生成一个 nested 查询,全部放入同一个 `bool.must`,即列表内所有规格条件都要满足(AND)。
    
    原有逻辑不变:不带 `_all` 的字段,数组仍为 OR(`terms`),单值仍为 `term`。
    
     2. `api/models.py`:filters 说明
    
    - 在 `filters` 的 `description` 中补充:
      - 字段名加 `_all` 表示 AND(如 `tags_all: ['A','B']` 表示同时包含 A 和 B)。
      - `specifications_all` 表示列表内所有规格条件都要满足。
    
     3. `docs/搜索API对接指南.md`:文档
    
    - 在 3.3.1 开头说明:任意字段名可加 `_all` 后缀表示多值 AND。
    - 在格式示例中增加 `tags_all`、`category1_name_all` 示例。
    - 在「支持的值类型」中说明:数组在带 `_all` 时为 AND。
    - 新增小节「`*_all` 语义(多值 AND)」:说明用法及 `specifications_all` 行为。
    - 在「常用过滤字段」中补充:以上字段均可加 `_all` 后缀。
    
    ---
    
    **使用示例**
    
    ```json
    {
      "filters": {
        "tags": ["手机", "促销"],
        "tags_all": ["手机", "促销", "新品"]
      }
    }
    ```
    
    - `tags`:命中「手机」或「促销」或两者都有(OR)。
    - `tags_all`:必须同时包含「手机」「促销」「新品」三个标签(AND)。
    tangwang
     

05 Feb, 2026

3 commits

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

04 Feb, 2026

1 commit


27 Jan, 2026

2 commits


26 Jan, 2026

4 commits


24 Jan, 2026

1 commit


09 Jan, 2026

3 commits


07 Jan, 2026

1 commit


06 Jan, 2026

5 commits

  • tangwang
     
  • tangwang
     
  • tangwang
     
  • 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/ 里所有旧字段名引用已批量替换为新结构。
    tangwang
     
  • tangwang
     

04 Jan, 2026

1 commit


31 Dec, 2025

4 commits


29 Dec, 2025

2 commits


27 Dec, 2025

2 commits


26 Dec, 2025

3 commits


25 Dec, 2025

3 commits


22 Dec, 2025

3 commits