From a7cc907878e7843651ce97fcc6ed1a02f5c91825 Mon Sep 17 00:00:00 2001 From: tangwang Date: Fri, 20 Mar 2026 17:02:19 +0800 Subject: [PATCH] sku排序 --- config/config.yaml | 29 ++++++++++++++++++++++++++++- frontend/index.html | 2 +- frontend/static/css/style.css | 114 +++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------- frontend/static/js/app.js | 153 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------ search/searcher.py | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++----------------- tests/test_search_rerank_window.py | 6 ++++-- 6 files changed, 200 insertions(+), 172 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index ebdbc16..04a54a6 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -90,7 +90,34 @@ query_config: # 返回字段配置(_source includes) # null表示返回所有字段,[]表示不返回任何字段,列表表示只返回指定字段 - source_fields: null + # 下列字段与 api/result_formatter.py(SpuResult 填充)及 search/searcher.py(SKU 排序/主图替换)一致 + source_fields: + - spu_id + - handle + - title + - brief + - description + - vendor + - category_name + - category_name_text + - category_path + - category_id + - category_level + - category1_name + - category2_name + - category3_name + - tags + - min_price + - compare_at_price + - image_url + - sku_prices + - sku_weights + - sku_weight_units + - total_inventory + - option1_name + - option1_values + - specifications + - skus # KNN boost配置(向量召回的boost值) knn_boost: 0.25 # Lower boost for embedding recall diff --git a/frontend/index.html b/frontend/index.html index 77ac86f..ede46f0 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -199,7 +199,7 @@ - +