From 52ae85fbf8c65620b2f533ddfef7d0d29c63d01e Mon Sep 17 00:00:00 2001 From: tangwang Date: Thu, 5 Mar 2026 23:27:42 +0800 Subject: [PATCH] 1. ES docs 2. 修改索引配置: 向量改为bf16 --- docs/ES/1_ES安装.md | 103 ------------------------------------------------------------------------------------------------------- docs/ES/1_ES配置和使用.md | 680 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- docs/ES/2_kibana安装.md | 51 --------------------------------------------------- docs/ES/3.1_hanlp安装.md | 116 -------------------------------------------------------------------------------------------------------------------- docs/ES/3.2_jieba插件安装.md | 107 ----------------------------------------------------------------------------------------------------------- docs/ES/3.3_ik分词器.md | 9 --------- docs/ES/3_ansj分词插件安装.md | 97 ------------------------------------------------------------------------------------------------- docs/ES/4_索引和查询测试.md | 74 -------------------------------------------------------------------------- docs/ES/ES_8.18/1_ES安装.md | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/ES/ES_8.18/1_ES配置和使用.md | 680 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/ES/ES_8.18/2_kibana安装.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ docs/ES/ES_8.18/3.1_hanlp安装.md | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/ES/ES_8.18/3.2_jieba插件安装.md | 107 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/ES/ES_8.18/3.3_ik分词器.md | 9 +++++++++ docs/ES/ES_8.18/3_ansj分词插件安装.md | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/ES/ES_8.18/4_索引和查询测试.md | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/ES/ES_8.18/README__ES查询相关.md | 701 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/ES/ES_8.18/README__分词相关.md | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/ES/ES_8.18/README__性能优化.md | 701 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/ES/ES_8.18/install.sh | 47 +++++++++++++++++++++++++++++++++++++++++++++++ docs/ES/ES_9 | 372 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ docs/ES/README__ES查询相关.md | 701 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- docs/ES/README__分词相关.md | 120 ------------------------------------------------------------------------------------------------------------------------ docs/ES/README__性能优化.md | 701 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- docs/ES/install.sh | 47 ----------------------------------------------- mappings/search_products.json | 9 ++++++--- 26 files changed, 3184 insertions(+), 2809 deletions(-) delete mode 100644 docs/ES/1_ES安装.md delete mode 100644 docs/ES/1_ES配置和使用.md delete mode 100644 docs/ES/2_kibana安装.md delete mode 100644 docs/ES/3.1_hanlp安装.md delete mode 100644 docs/ES/3.2_jieba插件安装.md delete mode 100644 docs/ES/3.3_ik分词器.md delete mode 100644 docs/ES/3_ansj分词插件安装.md delete mode 100644 docs/ES/4_索引和查询测试.md create mode 100644 docs/ES/ES_8.18/1_ES安装.md create mode 100644 docs/ES/ES_8.18/1_ES配置和使用.md create mode 100644 docs/ES/ES_8.18/2_kibana安装.md create mode 100644 docs/ES/ES_8.18/3.1_hanlp安装.md create mode 100644 docs/ES/ES_8.18/3.2_jieba插件安装.md create mode 100644 docs/ES/ES_8.18/3.3_ik分词器.md create mode 100644 docs/ES/ES_8.18/3_ansj分词插件安装.md create mode 100644 docs/ES/ES_8.18/4_索引和查询测试.md create mode 100644 docs/ES/ES_8.18/README__ES查询相关.md create mode 100644 docs/ES/ES_8.18/README__分词相关.md create mode 100644 docs/ES/ES_8.18/README__性能优化.md create mode 100644 docs/ES/ES_8.18/install.sh create mode 100644 docs/ES/ES_9 delete mode 100644 docs/ES/README__ES查询相关.md delete mode 100644 docs/ES/README__分词相关.md delete mode 100644 docs/ES/README__性能优化.md delete mode 100644 docs/ES/install.sh diff --git a/docs/ES/1_ES安装.md b/docs/ES/1_ES安装.md deleted file mode 100644 index 8bde5e9..0000000 --- a/docs/ES/1_ES安装.md +++ /dev/null @@ -1,103 +0,0 @@ - - - -## 一、安装 -### 1. 安装 -```shell -# 参考install_elasticsearch.sh。 - -ELASTICSEARCH_VERSION="8.18.0" - -wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo rpm --import -yum install -y https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$ELASTICSEARCH_VERSION-x86_64.rpm - -# 设置Elasticsearch的系统服务 -systemctl daemon-reload -systemctl start elasticsearch -systemctl enable elasticsearch -``` -安装、配置好后验证命令: curl -X GET "http://localhost:9200" - - -### 3. 工程&安全方面设置 - -性能相关配置: -```shell -vi /etc/elasticsearch/jvm.options -堆内存大小: --Xms32g --Xmx32g -``` - -/etc/elasticsearch/elasticsearch.yml : - -Fielddata Cache(用于聚合和排序操作): -indices.fielddata.cache.size: 40% # 将 fielddata 缓存大小设置为 40% 的物理内存 -Query Cache(用于查询缓存): -indices.queries.cache.size: 30% # 将查询缓存设置为 30% 的物理内存 - -修改的系统配置: -vi /etc/sysctl.conf -```shell -# tangwang -# 调整系统句柄限制 -fs.file-max = 1000000 -# 优化文件描述符 可以分配的vma数量 -vm.max_map_count = 655360 -# 优化脏内存页,es写入削峰 -vm.dirty_ratio=10 -vm.dirty_background_ratio=5 -vm.dirty_writeback_centisecs=200 -# 优化系统回收inode cache权重 -vm.vfs_cache_pressure=200 -vm.dirty_expire_centisecs=6000 -# 尽可能低的使用swap,内存很充裕可以设置为0,较低设置为1 -vm.swappiness=0 -``` -vi /etc/security/limits.conf -```shell -# tangwang 修改 下面都加了10倍 -# End of file -* soft nofile 655350 -* hard nofile 655350 -root soft nofile 655350 -root hard nofile 655350 -* soft nofile 655350 -* hard nofile 655350 - - -# tangwang 补充下面的 -* soft nproc 102400 -* hard nproc 409600 -# 允许进程锁定内存 -* soft memlock unlimited -* hard memlock unlimited -``` - - -### TOOD : -配置为单节点模式,discovery.type: single-node 但是还需要其他配套改动。 - -用户名 密码 安全方面 -kibana用户名密码 - -## 其他说明 -ES 8.x版本特性 -在 8.0版本 中,提供新的kNN 搜索 API。以前,Elasticsearch 仅支持使用script_score带有向量函数的查询进行精确的 kNN 搜索。虽然此方法可以保证准确的结果,但它通常会导致搜索速度缓慢,并且无法很好地适应大型数据集。作为索引速度较慢和准确性不完美的代价,新的 kNN 搜索 API 允许您以更快的速度对更大的数据集运行近似 kNN 搜索。 - -在 8.4版本中,把knn搜索加入到search API中,以支持 ANN 搜索。它由与旧 _knn_search端点相同的 Lucene ANN 功能提供支持。该knn选项可以与其他搜索功能(例如查询和聚合)结合使用。 - -在 8.7版本中,允许多个 KNN 搜索子句。某些向量搜索场景需要使用几个 kNN 子句进行相关性排名,例如,当基于多个字段进行排名时,每个字段都有自己的向量,或者当文档包含图像向量和文本向量时。用户可能希望获得基于所有这些 kNN 子句的组合的相关性排名。 - -在 8.8版本 中,将 Introducing Elastic Learned Sparse Encoder: Elastic’s AI model for semantic search — Elastic Search Labs 模型引入到我们的机器学习模型库中,您可以开箱即用。ELSER 通过启用语义搜索来提高搜索结果的相关性。这种搜索方法考虑单词的含义,而不是仅仅依赖字面术语。ELSER 是一种预训练的域外稀疏向量模型,无需对特定源数据进行微调。它从一开始就为您提供相关的搜索结果。并且在此版本中,还提升了KNN检索语法,加入了similarity参数,允许过滤给定相似性之外的最近邻结果。 - -在8.9版本中。text_embedding query_vector_builderkNN 搜索的扩展普遍可用。 - -在8.10版本中,启用跨段并行 knn 搜索,使得 knn 查询对由多个段组成的分片更快,来优化knn搜索的性能。 - - - - - -8.15 更为丰富的工具用于微调相关性、更高的模型灵活性、矢量搜索的改进 - diff --git a/docs/ES/1_ES配置和使用.md b/docs/ES/1_ES配置和使用.md deleted file mode 100644 index 569f12f..0000000 --- a/docs/ES/1_ES配置和使用.md +++ /dev/null @@ -1,680 +0,0 @@ -# Elasticsearch 文档 - -## 相关链接 -- 接口文档:http://rap.essa.top:88/workspace/myWorkspace.do?projectId=78#2187 -- Kibana 控制台:http://120.76.41.98:5601/app/dev_tools#/console/shell - -## 分词方面 - -Ansj 分词插件安装 -ES可以用的中文分词,效果最好的是hanLP和ansj,其次是jieba。 - -我们老的搜索 solr 已经在几年前替代掉了ik,使用的是mmseg。但是我没找到mmseg的ES插件。 - -为了分词方面不至于比老版本差,这里先安装了ansj - -### 1. 下载插件 -从 [elasticsearch-analysis-ansj releases](https://github.com/NLPchina/elasticsearch-analysis-ansj/releases) 选择对应版本下载: - -- ES 8.18 版本: -```bash -wget https://github.com/NLPchina/elasticsearch-analysis-ansj/archive/refs/tags/v8.18.0.zip -``` - -- ES 8.17 版本: -```bash -wget https://github.com/NLPchina/elasticsearch-analysis-ansj/archive/refs/tags/v8.17.6.zip -``` - -### 2. 编译 -执行 `mvn package` 命令,编译成功后将在 `target/releases/` 目录生成插件压缩包: -`elasticsearch-analysis-ansj-<版本号>-release.zip` - -### 3. 安装步骤 -1. 进入 ES 安装路径(默认:`/usr/share/elasticsearch/`) -2. 执行安装命令: -```bash -bin/elasticsearch-plugin install file:///xxx/绝对路径到/elasticsearch-analysis-ansj-8.18.0.0-release.zip -``` -3. 重启服务: -```bash -systemctl restart elasticsearch -``` - -其他分词插件安装方法: -《3.1_hanlp安装.md》 -《3.2_jieba插件安装.md》 -在ES8上面安装过,但是没试过具体的版本 8.17 8.18 - -### 4. 配置说明 -停用词、同义词配置位于 `/config/elasticsearch-analysis-ansj/ansj.cfg.yml`(暂未使用) - -## 字段说明 - -```bash -需要的字段: -id 商品skuId -goods_id 商品spuId -buyer_id 所属专属采购商id -trader_buyer_ids 所属贸易商名下平台客户的专属采购商id -goods_certification_types 商品证书类型 -supplier_code 供应商编码 -supplier_name 供应商名称 -supplier_certification_code 供应商企业证书编码(列表) -auth_buyer_level_list 商品可见采购商等级(集合) -show_price_level_list 价格可见采购商等级(集合) -goods_composition 成分列表(材质) -compositions_main_secondary 物料主副(主:1,副:2),格式:物料代码_主副类型 -goods_key_word_zh 商品关键词中文 -goods_key_word_en 商品关键词英文 -goods_key_word_ru 商品关键词俄文 -goods_copyright 版权(自有、第三方、无授权、A货) -goods_main_material 主材质(字典:材质) -is_in_new_protect 是否在新品保护期(0否,1是) -goods_new_protect_date_stamp 新品保护期日期时间戳 -goods_attribute_name_zh spu属性中文(列表) -goods_attribute_name_en spu属性英文(列表) -goods_attribute_name_ru spu属性俄文(列表) -purchase_moq 采购MOQ -ts 触发索引的时间 -deliver_day 货期 -factory_no 工厂货号 -factory_no_buyer 工厂货号(客户) -fir_on_sell_time 首次上架时间 -fir_on_sell_time_stamp 首次上架时间timestamp -no 商品编码 -hs_no 宏升编码 -package_type 包装类型值(来自商品属性编码:PKG) -package_type_id 包装类型ID(来自商品属性编码:PKG) -labelId_by_skuId_essaone_* essaone商品标签,国家编码标识 -sale_goods_certificate_* 商品证书ID,国家编码标识 -labelId_by_skuId_essa_* essa商品标签,区域ID标识 -``` - -## Mapping 配置 -参考文件 `create_index.sh`: - -## 快速入门 - -### Shell -参考 [索引和查询测试](../docs/3.3_索引和查询测试.md) 包含了在ES服务器进行本地进行一些常用的查询操作。 - -### Python -- [test_index_and_search.py](../tests/test_index_and_search.py) 是一个简单的例子,创建索引,导入数据,查询数据 -- [batch_bulk_goods.py](../batch_bulk_goods.py) 功能是 通过sql 读取最近3年的所有数据,按batch(1000)通过bulk接口进行逐批入库,入库到goods索引。 - -### Kibana - -#### 分词相关 -```bash -# 索引分词 -GET /_cat/ansj?text=14寸第4代真眼珠实身冰雪公仔带手动大推车,搪胶雪宝宝&type=index_ansj - -# 查询分词 -GET /_cat/ansj?text=14寸第4代真眼珠实身冰雪公仔带手动大推车,搪胶雪宝宝&type=query_ansj - -# 查看配置 -GET /_cat/ansj/config -``` -#### 查询相关 -GET /goods/_search -{ - "query": { - "match_all": {} - }, - "size": 5 -} - -#### 1. 查看字段分词结果 -```bash -# 查看中文名称分词结果 -GET /_cat/ansj?text=14寸第4代真眼珠实身冰雪公仔带手动大推车&type=index_ansj - -# 查看英文名称分词结果 -GET /_cat/ansj?text=14 inch 4th generation real eye snow doll with manual cart&type=standard -``` - -#### 2. 查看索引随机10条内容 -```bash -GET /goods/_search -{ - "size": 10, - "query": { - "function_score": { - "query": { "match_all": {} }, - "random_score": {} - } - } -} -``` - -#### 3. 关键词查询 -```bash -# 简单关键词匹配 -GET /goods/_search -{ - "query": { - "match": { - "name_zh": "冰雪公仔" - } - } -} - -# 多字段关键词匹配 -GET /goods/_search -{ - "query": { - "multi_match": { - "query": "冰雪公仔", - "fields": ["name_zh", "sub_name_zh", "category_name_zh"] - } - } -} -``` - -#### 4. 向量查询 -```bash -# 使用向量相似度查询 -GET /goods/_search -{ - "query": { - "script_score": { - "query": { "match_all": {} }, - "script": { - "source": "cosineSimilarity(params.query_vector, 'name_prefix') + 1.0", - "params": { - "query_vector": [0.1, 0.2, ...] # 1024维向量 - } - } - } - } -} -``` - -#### 5. SKUID查询 -```bash -# 精确匹配SKUID -GET /goods/_search -{ - "query": { - "term": { - "goods_id": "2817667" - } - } -} -``` - -#### 6. 名称查询测试 -```bash -# 中文名称模糊匹配 -GET /goods/_search -{ - "query": { - "match": { - "name_zh": { - "query": "冰雪公仔", - "fuzziness": "AUTO" - } - } - } -} - -# 英文名称匹配 -GET /goods/_search -{ - "query": { - "match": { - "name_en": "snow doll" - } - } -} - -# 俄语名称匹配 -GET /goods/_search -{ - "query": { - "match": { - "name_ru": "снежная кукла" - } - } -} - -# 使用 match_phrase 进行短语匹配 -GET /goods/_search -{ - "query": { - "match_phrase": { - "name_zh": "冰雪公仔" - } - } -} - -# 使用 match_phrase 进行多语言短语匹配 -GET /goods/_search -{ - "query": { - "bool": { - "should": [ - { - "match_phrase": { - "name_zh": "冰雪公仔" - } - }, - { - "match_phrase": { - "name_en": "snow doll" - } - }, - { - "match_phrase": { - "name_ru": "снежная кукла" - } - } - ], - "minimum_should_match": 1 - } - } -} - -# 使用 match_phrase 配合 slop 参数进行模糊短语匹配 -GET /goods/_search -{ - "query": { - "match_phrase": { - "name_zh": { - "query": "冰雪公仔", - "slop": 2 - } - } - } -} - -# 多语言 match_phrase 配合 slop 参数 -GET /goods/_search -{ - "query": { - "bool": { - "should": [ - { - "match_phrase": { - "name_zh": { - "query": "冰雪公仔", - "slop": 2 - } - } - }, - { - "match_phrase": { - "name_en": { - "query": "snow doll", - "slop": 1 - } - } - }, - { - "match_phrase": { - "name_ru": { - "query": "снежная кукла", - "slop": 2 - } - } - } - ], - "minimum_should_match": 1 - } - } -} -``` - -#### 7. 多语言查询测试 -```bash -# 同时查询中英文名称 -GET /goods/_search -{ - "query": { - "bool": { - "should": [ - { - "match": { - "name_zh": "冰雪公仔" - } - }, - { - "match": { - "name_en": "snow doll" - } - } - ], - "minimum_should_match": 1 - } - } -} -``` - -#### 8. 向量索引查询测试 -注意:向量查询中的向量维度必须与索引中定义的维度匹配(1024维) -```bash -# 使用向量相似度进行商品推荐 -GET /goods/_search -{ - "query": { - "script_score": { - "query": { "match_all": {} }, - "script": { - "source": "cosineSimilarity(params.query_vector, 'ru_name') + 1.0", - "params": { - "query_vector": [0.1, 0.2, ...] # 1024维向量 - } - } - } - }, - "size": 10 -} -``` - -#### 9. 关键词+向量索引组合查询测试 -```bash -# 关键词搜索+向量相似度提权 -GET /goods/_search -{ - "query": { - "function_score": { - "query": { - "match": { - "name_zh": "冰雪公仔", - "boost": 1.0 - } - }, - "functions": [ - { - "script_score": { - "script": { - "source": "cosineSimilarity(params.query_vector, 'name_prefix') + 1.0", - "params": { - "query_vector": [0.1, 0.2, ...] # 1024维向量 - } - } - } - } - ], - "boost_mode": "multiply" - } - } -} - -# source 可以支持embedding为空 : "source": "doc['embedding'].isEmpty() ? 1.0 : dotProduct(params.query_vector, 'embedding') + 1.0", - -两者乘起来: -{ - "query": { - "function_score": { - "score_mode": "sum", - "boost_mode": "multiply", - "query": { - "match": { - "content": { - "query": keywords, - "boost": 1.0 - } - } - }, - "functions": [ - { - "script_score": { - "script": { - "source": "doc['embedding'].isEmpty() ? 1.0 : dotProduct(params.query_vector, 'embedding') + 1.0", - "params": {"query_vector": context.embeddings[0][1]} - } - } - } - ] - } - } - } - -#### 9. 向量搜索+关键词搜索 -GET /goods/_search -{ - "query": { - "match": { - "content": { - "query": "玩具", - "boost": 1.0 - } - } - }, - "knn": { - "field": "name_prefix", - "query_vector": [-0.05291186273097992, ...], - "k": 5, - "num_candidates": 10, - "boost": 1.0 - } - } - - - - -参考代码: -```python - def execute_search(self, context, search_type="match_phrase", search_type_attachment=0, size=10): - query = context.query - normalized_query = context.normalized_query - core_term = context.core_term - keywords = context.keywords - knn_boost_keywords = core_term if core_term else keywords - expand = context.expand - - seen_queries = set() - unique_queries = [] - for q, weight in [(query, 1.0), (normalized_query, 1.0), (keywords, 0.5)]: - if q and q not in seen_queries: - unique_queries.append((q, weight)) - seen_queries.add(q) - - # 关于混合检索: - # knn和文本查询同时作用: - # 8.12之前query里面不能包含knn,kNN搜索作为查询已在 8.12 版本中引入: https://www.elastic.co/search-labs/blog/knn-query-elasticsearch - # { - # "size": 3, - # "query": { - # "bool": { - # "should": [ - # { - # "knn": { - # "field": "embedding", - # "query_vector": [2,2,2,0], - # "num_candidates": 10, - # "_name": "knn_query" - # } - # }, - # { - # "match": { - # "description": { - # "query": "luxury", - # "_name": "bm25query" - # } - # } - # } - # ] - # } - # - # knn里面不能包含query。 - # knn和query并列(hybrid search 混合检索),是求或的关系。 - # knn里面可以加filter,比如: "filter": {"match": {"my_label": "red"}} - - if search_type == "match_phrase": - body = { - "query": { - "bool": { - "should": [ - { - "match_phrase": { - "content": { - "query": unique_query, - "boost": weight, - "slop": search_type_attachment - } - } - } for unique_query, weight in unique_queries - ], - "minimum_should_match": 1 - } - } - } - # 纯关键词检索 2 - elif search_type == "match_keywords": - body = { - "query": { - "bool": { - "must": [ - { - "match": { - "content": {"query": core_term, "boost": 1.0} - } - } - ], - "should": [ - { - "match": { - "content": {"query": q, "boost": boost} - } - } for (q, boost) in [(keywords, 1.0), (expand, 0.6), (normalized_query, 1.0)] if q - ], - "minimum_should_match": 1 - } - } - } - # 关键词搜索+向量排序 - elif search_type == "match&boost": - body = { - "query": { - "function_score": { - "score_mode": "sum", - "boost_mode": "multiply", - "query": { - "match": { - "content": { - "query": keywords, - "boost": 1.0 - } - } - }, - "functions": [ - { - "script_score": { - "script": { - "source": "doc['embedding'].isEmpty() ? 1.0 : dotProduct(params.query_vector, 'embedding') + 1.0", - "params": {"query_vector": context.embeddings[0][1]} - } - } - } - ] - } - } - } - # 这个太慢 - elif search_type == "match&boost2": - body = { - "query": { - "script_score": { - "query": { - "match": { - "content": { - "query": keywords, - "boost": 1.0 - } - } - }, - "script": { - "source": "doc['embedding'].isEmpty() ? 1.0 : dotProduct(params.query_vector, 'embedding') + 1.0", - "params": {"query_vector": context.embeddings[0][1]} - } - } - } - } - # 向量搜索+关键词搜索 - elif search_type == "match&knn": - body = { - "query": { - "match": { - "content": { - "query": knn_boost_keywords, - "boost": 1.0 - } - } - }, - "knn": { - "field": "embedding", - "query_vector": context.embeddings[search_type_attachment][1], - "k": 5, - "num_candidates": 10, - "boost": 1.0 - } - } - # 纯向量搜索 - elif search_type == "knn": - body = { - "knn": { - "field": "embedding", - "query_vector": context.embeddings[search_type_attachment][1], - "k": 5, - "num_candidates": 10 - } - } - - need_embedding = (search_type == "match&boost") - need_highlights = (search_type != "knn") - - body["_source"] = {"excludes": ["keywords", "quotes"]} - if not need_embedding: - body["_source"]["excludes"].append("embedding") - # 在填充highlight之前写入search_from - search_from = f'searchtype[{search_type}],param[{search_type_attachment}],body:{body}' - - if need_highlights: - body["_source"]["excludes"] = [] - body["highlight"] = { - "pre_tags": [settings.HIGHTLIGHT_PRE_TAG], - "post_tags": [settings.HIGHTLIGHT_POST_TAG], - "fields": {"chapter_name": {}, "content": {}} - } - - body["size"] = size - - se_debug_info = '' - start_time = time.time() - try: - es_response = context.es.search(index=context.index_name, body=body) - except Exception as e: - se_debug_info = f'Error in executing search: {e}. request: {body}' - return None, se_debug_info - end_time = time.time() - elapsed_time = end_time - start_time - total_hits = es_response.get("hits", {}).get("total", {}).get("value", 0) - returned_hits = len(es_response.get("hits", {}).get("hits", [])) - - if not '"' in search_from: - search_from = search_from.replace('\'', '"') - search_from = search_from if len(search_from) < 400 else search_from[:400] + '...' - - str_body = str(body) - if not '"' in str_body: - str_body = str_body.replace('\'', '"') - se_debug_info = f'({elapsed_time:.2f} seconds. Total: {total_hits}. Returned: {returned_hits}) : {search_from[:400]}' - - if not 'hits' in es_response or not 'hits' in es_response['hits']: - se_debug_info += f' InvalidResponce in executing search: {e}. request: {body}' - return None, se_debug_info - - for hit in es_response['hits']['hits']: - hit['search_from'] = search_from - - return es_response, se_debug_info - -``` - - -# 测试向量: -# [-0.05291186273097992, 0.0274342093616724, -0.016730275005102158, 0.010487289167940617, -0.022640341892838478, -0.048682719469070435, 0.04544096067547798, 0.023079438135027885, 0.007221410982310772, 0.023566091433167458, 0.026696473360061646, 0.08252757787704468, -0.042835772037506104, 0.0009668126585893333, -0.02860398218035698, -0.004426108207553625, -0.002644421299919486, -0.027699561789631844, 0.005749804899096489, -0.04468372091650963, -0.0296687763184309, -0.009487600065767765, 0.020041221752762794, 0.00778265530243516, 0.008522099815309048, 0.03497027978301048, -0.021573258563876152, -0.028293319046497345, -8.54598984005861e-05, -0.03164539486169815, -0.017121458426117897, -0.0006902766763232648, 0.04650883004069328, -0.030234992504119873, -0.010207684710621834, -0.035288386046886444, -0.0047269039787352085, -0.0006454040994867682, -0.056146346032619476, 0.008901881985366344, 0.010757357813417912, -0.013022932223975658, 0.04627145081758499, -0.020669423043727875, -0.02031278982758522, -0.052186835557222366, -0.0148158585652709, -0.018267231062054634, -0.059003304690122604, -0.011793344281613827, 0.027096575126051903, 0.019299808889627457, 0.04161312058568001, -0.019393721595406532, -0.02361445501446724, 0.07711422443389893, -0.02068573422729969, -0.004702702630311251, -0.011135494336485863, 0.0101374052464962, -0.020808257162570953, 0.011924360878765583, -0.020093027502298355, -0.007138500455766916, 0.014727798290550709, 0.05770261213183403, 0.017841406166553497, 0.044339124113321304, -0.01490224339067936, -0.008343652822077274, -0.04842463508248329, 0.0336640290915966, -0.004893577191978693, -0.021536342799663544, -0.032384153455495834, -0.009452177211642265, -0.027460120618343353, -0.009426826611161232, 0.006357531528919935, 0.019494572654366493, 0.009722599759697914, -0.00497430982068181, 0.023032115772366524, 0.05221958085894585, -0.01671120524406433, 0.061740316450595856, -0.06789620220661163, -0.023851843550801277, -0.02249223366379738, -0.01231105625629425, -0.0499565526843071, 0.004251780919730663, 0.05466651916503906, -0.024449756368994713, -0.034151963889598846, 0.037387508898973465, -0.0016276679234579206, -0.02609393745660782, 0.01800747588276863, -0.0028136332985013723, -0.06036405637860298, 0.028903907164931297, 0.006318055558949709, 0.012870929203927517, -0.0021476889960467815, -0.012034566141664982, -0.008372323587536812, 0.024942906573414803, 0.08258169889450073, 0.006757829803973436, 0.032017264515161514, -0.012414710596203804, 0.014826267957687378, -0.040858786553144455, -0.0060302577912807465, 0.00843990221619606, -0.031066348776221275, -0.06313654035329819, 0.0056659989058971405, -0.007768781390041113, 0.011673268862068653, 0.007261875085532665, 0.006112886127084494, -0.07374890148639679, 0.06602894514799118, -0.05385972931981087, -0.0010994652984663844, 0.05939924344420433, 0.015503636561334133, 0.034621711820364, 0.008040975779294968, -0.023962488397955894, -0.06270411610603333, 0.00027893096557818353, -0.0436306893825531, -0.006309020332992077, 0.02416943572461605, -0.015391307882964611, -0.012442439794540405, -0.003181715961545706, -0.0021985983476042747, 0.008671553805470467, 0.004063367377966642, -0.02560708485543728, 0.03469422832131386, -0.04249674826860428, -0.013552767224609852, -0.052823010832071304, 0.014670411124825478, -0.011493593454360962, 0.024076055735349655, 0.056352417916059494, -0.008510314859449863, 0.015936613082885742, 0.003935575485229492, 0.0037949192337691784, 0.015074086375534534, 0.016583971679210663, -0.0057802870869636536, 0.005751866847276688, -0.009386995807290077, -0.03710195794701576, -0.03144300729036331, -0.07106415182352066, -0.003882911056280136, -0.010697683319449425, -0.014338435605168343, 0.007036983501166105, -0.035716522485017776, 0.06593189388513565, 0.007752529811114073, -0.030261363834142685, -0.02513342909514904, -0.039278656244277954, 0.015320679172873497, -0.012659071013331413, 0.014207725413143635, 0.010264124721288681, 0.01617652177810669, -0.022644126787781715, -0.031033707782626152, 0.04160666465759277, -0.05329348146915436, 0.02423500455915928, -0.019389694556593895, 0.008645910769701004, -0.005958682857453823, -0.03648180514574051, 0.011972597800195217, 0.037404924631118774, -0.007001751102507114, -0.05138246342539787, 0.0013400549069046974, -0.03268183395266533, 0.07687076926231384, -0.02033335529267788, -0.020667986944317818, 0.0038236891850829124, 0.029960744082927704, 0.015430699102580547, 0.05047214776277542, 0.0052254535257816315, 0.013995353132486343, -0.031164521351456642, -0.014291719533503056, 0.015829795971512794, -0.0013409113744273782, -0.044300951063632965, 0.045415859669446945, -0.005037966184318066, -0.03883415088057518, 0.027200160548090935, 0.008182630874216557, -0.046456750482320786, -0.029778052121400833, 0.02067168429493904, -0.006381513085216284, -0.04693000763654709, 0.009974686428904533, 0.03109011799097061, -0.012696364894509315, 0.030124813318252563, 0.02372679114341736, 0.06566771119832993, 0.03553507477045059, -0.032816141843795776, 0.028003521263599396, 0.06498659402132034, -0.013530750758945942, 0.0312667116522789, -0.015660811215639114, -0.00776742585003376, -0.004829467739909887, -0.015968922525644302, 0.04765664413571358, -0.0026502758264541626, 0.01891564577817917, 0.04119837284088135, 0.012158435769379139, 0.008338023908436298, -0.006039333995431662, 0.0630166307091713, -0.02758428454399109, 0.029347822070121765, -0.030129415914416313, 0.023165738210082054, 0.04064684361219406, 0.04446929693222046, -0.006133638322353363, -0.013095719739794731, -0.041152223944664, -0.01038535125553608, 0.01738007925450802, 0.0010595708154141903, -0.055003564804792404, 0.036829687654972076, -0.030270753428339958, -0.009607627056539059, 0.014103117398917675, 0.005140293389558792, 0.032931022346019745, 0.026972685009241104, -0.00039128100615926087, 0.00550195062533021, 0.062454141676425934, 0.02344602160155773, -0.01688288524746895, 0.011600837111473083, 0.009648085571825504, 0.012827200815081596, 0.02368510514497757, -0.044808436185121536, 0.006574536208063364, 0.03677171841263771, 0.021754244342446327, -0.0031720376573503017, -0.03498553857207298, -0.027119319885969162, 0.05196662247180939, 0.0063033513724803925, -0.002766692778095603, -0.03879206255078316, -0.005737128667533398, -0.02351462095975876, 0.04338989034295082, -0.03623301535844803, 0.003727369010448456, 0.044172726571559906, 0.06180792301893234, -0.025736358016729355, 0.01280374638736248, -0.01768171414732933, 0.0413120836019516, 0.036350950598716736, 0.020034022629261017, -0.00938474852591753, -0.04920303076505661, -0.1626604050397873, 0.0016566020203754306, -0.010797491297125816, 0.0037245014682412148, 0.039030417799949646, -0.009399985894560814, 0.016659803688526154, -0.047097429633140564, -0.00987484585493803, 0.020634479820728302, 0.005361238028854132, -0.05283225327730179, 0.002501025330275297, -0.004766151309013367, 0.00850654486566782, -0.0050267502665519714, -0.046555373817682266, 0.012670878320932388, 0.0018581973854452372, -0.010647253133356571, 0.01990092545747757, 0.02013244479894638, 0.04490885138511658, 0.029433563351631165, -0.01408607978373766, 0.029722925275564194, 0.04512600228190422, -0.04305345192551613, 0.0053901285864412785, -0.010685979388654232, 0.01516974437981844, 0.02340293675661087, -0.014181641861796379, -0.0013334851246327162, 0.020624764263629913, 0.06469231843948364, 0.016654038801789284, -0.043994754552841187, 0.025707466527819633, -0.004160136915743351, 0.021129926666617393, 0.041262850165367126, 0.006293899845331907, 0.056005991995334625, -0.006883381400257349, -0.07502268254756927, -0.02920101210474968, -0.019043054431676865, 0.00737513042986393, 0.013621360063552856, -0.02504715882241726, -0.01138006430119276, -0.010744514875113964, -0.02502342313528061, -0.03335903584957123, 0.012180354446172714, -0.03276645019650459, 0.05202409625053406, 0.03246080502867699, 0.03068908303976059, -0.029587913304567337, -0.04850265011191368, -0.006388102192431688, -0.03203853219747543, -0.050761956721544266, -0.021925227716565132, 0.036384399980306625, -0.011895880103111267, -0.007408954203128815, -0.012625153176486492, 0.0024322718381881714, -0.012196220457553864, -0.007011729292571545, -0.0337890200316906, -0.030034994706511497, 0.04638829082250595, -0.028362803161144257, -0.01176459901034832, 0.00956833828240633, -0.12054562568664551, -0.020540419965982437, 0.014624865725636482, -0.025515791028738022, -0.005027926992624998, -0.03586679324507713, -0.05585843697190285, -0.01700599677860737, -0.00044939795043319464, 0.029278729110956192, 0.25503888726234436, -0.024952411651611328, 0.005794796161353588, -0.007252118084579706, 0.03397773951292038, -0.0030146583449095488, -0.016645856201648712, -0.0008194005931727588, 0.02789629064500332, -0.039116114377975464, -0.035631854087114334, 0.04917449131608009, -0.006455820053815842, -0.011818122118711472, -0.00958359707146883, 0.013176187872886658, 0.037286531180143356, 0.022334400564432144, 0.05832865461707115, 0.010104321874678135, -0.04915979504585266, -0.022671189159154892, -0.016606582328677177, -0.007431587669998407, 0.0025214774068444967, -0.038979604840278625, 0.014895224012434483, 0.03583076596260071, 0.0006473385728895664, 0.04958082735538483, -0.017827684059739113, 0.015710417181253433, 0.062094446271657944, -0.014381879940629005, 0.0002880772517528385, 0.004948006477206945, -8.711735063116066e-06, -0.0029445397667586803, -0.044325683265924454, 0.047702621668577194, -0.03197811171412468, -0.02109563909471035, 0.03041824884712696, 0.021582895889878273, -0.004118872340768576, -0.025784745812416077, 0.06275995075702667, 0.006879465654492378, 0.04185185581445694, 0.02031264826655388, -0.02274201810359955, -0.009617358446121216, -0.04315454140305519, -0.033287111669778824, -0.025126483291387558, -0.003923895303159952, -0.041508499532938004, -0.0009355457150377333, -0.033565372228622437, 0.02229289337992668, -0.0026574484072625637, -0.0028596664778888226, -0.02223617024719715, -0.016868866980075836, 0.04172029718756676, 0.0014162511797621846, -0.037737537175416946, -0.010155809111893177, -0.010357595980167389, 0.04541466012597084, 0.03563382104039192, -0.019189776852726936, -0.012577632442116737, -0.013781189918518066, 0.026566311717033386, 0.020911909639835358, 0.02781282551586628, 0.053938526660203934, 0.0194545891135931, 0.0015139722963795066, -0.0357731431722641, -0.005088387057185173, 0.004257760010659695, 0.04332628846168518, -0.012149352580308914, -0.04734082147479057, 0.018029984086751938, -0.01322091929614544, -0.059820450842380524, -0.03677783161401749, -0.006745075341314077, -0.02209635078907013, -0.012663901783525944, -0.0059855030849576, 0.016270749270915985, -0.00725028058513999, 0.03019685670733452, 0.010252268984913826, -0.06314245611429214, -0.005512078758329153, -0.016377074643969536, -0.0014438428916037083, 0.029021194204688072, -0.015355946496129036, 0.02559172362089157, -0.04241044819355011, 0.010147088207304478, -0.016036594286561012, 0.023162752389907837, 0.047236304730176926, 0.0166736152023077, 0.01226564310491085, -0.015224735252559185, -0.01298521552234888, -0.008012642152607441, 0.028470756486058235, -0.013741613365709782, 0.019896863028407097, 0.01720179058611393, 0.01571199856698513, 0.030143165960907936, -0.02969514951109886, 0.014739652164280415, -0.01854291744530201, -0.045576371252536774, -0.04516203701496124, 0.02147211693227291, 0.007073952350765467, 0.008106761611998081, -0.01828523352742195, 0.002731812885031104, -0.04545339569449425, 0.019007619470357895, 0.03504781052470207, 0.037705861032009125, -0.0045634908601641655, 0.0070000626146793365, 0.0037205498665571213, 0.005224148277193308, -0.017060590907931328, -0.04246727377176285, -0.006265614647418261, -0.015374364331364632, -0.03380871191620827, -0.005029333755373955, 0.007065227720886469, 0.003886009333655238, 0.008613690733909607, -0.012133199721574783, 0.005556005053222179, -0.021959641948342323, 0.04834386706352234, 0.03787781298160553, -0.057815466076135635, 0.015909207984805107, -0.03855409845709801, 0.0018244135426357388, 0.04186264052987099, -0.054983459413051605, 0.006219237111508846, 0.03494301065802574, 0.023722950369119644, 0.0312604121863842, 0.05597991123795509, -0.030345493927598, 0.016615940257906914, -0.0207205917686224, 0.055960651487112045, -0.012713379226624966, -0.0261109359562397, 0.014332456514239311, -0.017245708033442497, -0.06636268645524979, 0.00592504907399416, 0.04649018123745918, -0.018362276256084442, 0.009620632976293564, -0.0044480785727500916, -0.0014729035319760442, 0.015621249563992023, 0.0367378331720829, -0.011857259087264538, -0.045088741928339005, 0.0006832792423665524, 0.02601524256169796, -0.02120809443295002, 0.018104318529367447, 0.008069046773016453, 0.013658273033797741, 0.004183551296591759, -0.04133244603872299, 0.05436890944838524, 0.009334285743534565, -0.014695074409246445, -0.011054124683141708, 0.009796642698347569, -0.008759389631450176, -0.06399217247962952, -0.0028859861195087433, -0.008736967109143734, -0.003506746841594577, 0.008123806677758694, 0.008794951252639294, -0.02940259501338005, 0.009597218595445156, -0.02197900228202343, -0.02082076109945774, 0.023915970697999, -0.059058744460344315, -0.010253551416099072, 0.024443935602903366, -0.029604850336909294, 0.008135135285556316, 0.03568771481513977, -0.017330091446638107, -0.003135789418593049, 0.035103678703308105, 0.0370408296585083, -0.01022601593285799, -0.045891791582107544, 0.01726667769253254, -0.008570673875510693, 0.015297998674213886, -0.015412220731377602, -0.01425748411566019, 0.031544867902994156, 0.013110813684761524, -0.057211123406887054, -0.0008968000765889883, 0.001981658162549138, -0.002101168967783451, -0.09516698867082596, -0.034693196415901184, 0.011157260276377201, 0.010063023306429386, -0.02550840750336647, 0.009959851391613483, 0.022281678393483162, -0.03908146917819977, 0.02196437120437622, 0.03520793840289116, -0.06856158375740051, -0.004901218693703413, 0.1122148334980011, -0.01498009730130434, 0.03165500983595848, -0.07618033140897751, -0.014297851361334324, 0.02150021120905876, 0.005999598652124405, -0.013493427075445652, 0.013868110254406929, 0.00079053093213588, 0.006475066766142845, 0.000955471652559936, -0.03403160721063614, -0.02295752801001072, 0.0041635241359472275, -0.03955964744091034, -0.04943346977233887, 0.00032474088948220015, 0.039174411445856094, -0.011974001303315163, 0.008057610131800175, 0.03809700161218643, -0.041719768196344376, 0.037615906447172165, -0.035932306200265884, 0.008293192833662033, -0.03261689469218254, -0.023902395740151405, -7.811257091816515e-05, -0.011328466236591339, -0.026476409286260605, 0.055370282381772995, 0.03128054738044739, -0.014991461299359798, 0.017835773527622223, 0.01642710715532303, 0.029273470863699913, -0.012139911763370037, 0.01371818222105503, -0.013113478198647499, -0.04071088507771492, 0.0233455840498209, -0.019497444853186607, -0.01747158169746399, 0.02493683062493801, 0.024074571207165718, -0.03614620864391327, -0.025289475917816162, -0.04030011221766472, -0.046772539615631104, 0.009969661012291908, 0.003724620910361409, 0.007474626414477825, -0.04855594411492348, 0.04697829484939575, 0.010695616714656353, 0.027944304049015045, -0.003937696572393179, -0.011591222137212753, -0.011533009819686413, 0.03215765953063965, -0.04699324443936348, -9.356102236779407e-05, -0.01535400003194809, -0.010238519869744778, 0.002703386126086116, 0.04759520664811134, 0.0074842446483671665, -0.04050430282950401, -0.028402622789144516, -0.03205197677016258, 0.011288953013718128, 0.006053865421563387, 0.04641448333859444, 0.005652922671288252, -0.018560705706477165, 0.02581481821835041, 0.00962467584758997, -0.017888177186250687, -0.026476262137293816, -0.005547264125198126, 0.012222226709127426, -0.004069746006280184, -0.020438821986317635, 0.01929863728582859, -0.0053736320696771145, 0.02221786603331566, -0.007175051141530275, 0.003961225971579552, -0.012380941770970821, -0.0040277824737131596, 0.009086307138204575, 0.012202796526253223, 0.018483169376850128, 0.017530532553792, 0.0422886498272419, 0.04987001419067383, 0.003722204128280282, 0.06421508640050888, -0.016258088871836662, -0.027659112587571144, 0.004458434879779816, -0.02898143045604229, -0.014475414529442787, 0.032039571553468704, -0.025734663009643555, -0.01585981249809265, 0.04900333285331726, -0.06422552466392517, -0.0007134959450922906, -0.04035528376698494, 0.03290264680981636, -0.0018848407780751586, 0.0068516512401402, 0.00032433189335279167, -0.002669606124982238, -0.017596688121557236, -0.026878179982304573, 0.014075388200581074, 0.020072080194950104, -0.00295435544103384, -0.01918656937777996, -0.007689833641052246, 0.039347097277641296, 0.0026605715975165367, 0.011779646389186382, 0.04189120978116989, -0.03846775367856026, -0.01993645168840885, 0.04546443000435829, 0.05682912468910217, -0.012384516187012196, -0.004507445730268955, 0.007476931903511286, -0.01160018052905798, 0.006559243891388178, 0.04354899004101753, 0.006185194011777639, 0.028355205431580544, -0.006518798414617777, -0.029528537765145302, 0.06740271300077438, -0.052158474922180176, 0.0025031850673258305, -0.005957300774753094, 0.00500349560752511, 0.022637680172920227, -0.0027129461523145437, -0.011677206493914127, -0.042732879519462585, -0.0021236639004200697, -0.1499215066432953, 0.02914350852370262, -0.031246500089764595, -0.027244996279478073, -0.006904688663780689, 0.01088196225464344, 0.01271661464124918, -0.0430884025990963, -0.020760131999850273, -0.006593034137040377, -0.0007962957606650889, -0.031729113310575485, 0.052976224571466446, -0.03149586543440819, 0.0392388291656971, 0.023318620398640633, -0.01383691094815731, 0.02858218550682068, 0.023135144263505936, 0.026421336457133293, 0.00027594034327194095, -0.03901490569114685, 0.008533132262527943, -0.03802476078271866, -0.011105065234005451, -0.028275510296225548, 0.04846742004156113, 0.021237077191472054, -0.027375172823667526, -0.02717825025320053, -0.031243441626429558, -0.021638689562678337, 0.024066096171736717, 0.05689090117812157, -0.04352620989084244, 0.03599394112825394, 0.05153508856892586, 0.002263782313093543, 0.047110624611377716, 0.006084555760025978, 0.003244618885219097, -0.0015037712873890996, 0.027960799634456635, -0.013650861568748951, 0.03281615301966667, 0.012363187968730927, 0.02162906341254711, -0.010951842181384563, -0.02786285988986492, 0.03754381462931633, 0.01957041770219803, -0.017010418698191643, -0.008339766412973404, 0.0755641758441925, 0.023412147536873817, -0.005748848430812359, -0.05465301498770714, -0.02190011739730835, 0.0054182386957108974, 0.032733004540205, -0.05342638120055199, 0.009907999075949192, -0.02370712347328663, -0.015652501955628395, -0.011254304088652134, -0.019827252253890038, -0.021032121032476425, -0.02607329562306404, -0.0008710312540642917, -0.06800976395606995, -0.017296750098466873, 0.015312970615923405, -0.015649013221263885, -0.016449443995952606, -0.012058117426931858, 0.002104945247992873, 0.020476385951042175, 0.014795565977692604, -0.02145536057651043, -0.028734024614095688, -0.041212357580661774, -0.008211270906031132, 0.033569078892469406, -0.0033273063600063324, -0.02339683100581169, 0.0421740785241127, -0.009677124209702015, -0.006869456730782986, -0.016001028940081596, 0.029614608734846115, -0.06062136963009834, -0.011824233457446098, 0.012096629478037357, -0.028248939663171768, -0.03703905642032623, 0.012119539082050323, -0.041021380573511124, 0.01975782960653305, -0.028443211689591408, 0.020459437742829323, 0.0073023103177547455, -0.06498327851295471, -0.004016770515590906, 0.06460512429475784, -0.053343966603279114, 0.03865537419915199, -5.4113028454594314e-05, -0.008642046712338924, -0.009384138509631157, -0.037736788392066956, -0.035090748220682144, 0.018596891313791275, -0.008763385005295277, 0.040228284895420074, 0.03811536356806755, -0.034618355333805084, -0.004665717948228121, 0.04813361540436745, -0.004303373862057924, 0.00795511994510889, -0.017838604748249054, 0.00563138909637928, -0.03171280398964882, -0.0259436946362257, 0.004301885142922401, -0.02739236131310463, 0.03270035237073898, 0.009064823389053345, -0.0363747663795948, 0.02325567975640297, 0.03453107923269272, -0.012906554155051708, 0.028347544372081757, 0.01234712265431881, 0.030589573085308075, 0.0024874424561858177, -0.0173872709274292, 0.0247347354888916, 0.004171399865299463, 0.02350561134517193, -0.05499064922332764, -0.023146219551563263, -0.012485259212553501, -0.0228674728423357, 0.013267520815134048, 0.021304689347743988, -0.018937893211841583, -0.0260267723351717, -0.022532619535923004, 0.0030378480441868305, -0.008528024889528751, -0.030528495088219643, -0.009305189363658428, -0.0074027362279593945, -0.020641637966036797, 0.006984233390539885, 0.04300186410546303, -0.033014994114637375, -0.006089311558753252, 0.04753036051988602, -0.036625705659389496, -0.04691743850708008, -0.007467558141797781, 0.0652017593383789, -0.03861508145928383, -0.00741452956572175, 0.003471594536677003, 0.016132064163684845, 0.01570185460150242, 0.018733495846390724, -0.019025148823857307, 0.003490244736894965, -0.017714614048600197, -0.003447450464591384, 0.015267218463122845, 0.015076974406838417, -0.002631498035043478, 0.005311752203851938, 0.014075293205678463, 0.0026123111601918936, 0.011874910444021225, 0.0714355856180191, 0.06941138952970505, 0.022251378744840622, 0.01972009800374508, 0.04719123989343643, 0.023544959723949432, 0.017852554097771645, 0.01843070052564144, -0.05294886603951454, -0.008682304993271828, 0.010625398717820644, 0.0428495928645134, 0.002173527143895626, 0.06291069090366364, 0.024296458810567856, 0.008714474737644196, 0.06520587205886841, 0.015627536922693253, 0.04247526824474335, 0.0009774811333045363, 0.00738496845588088, -0.024803027510643005, 0.013228596188127995, -0.037615202367305756, -0.028807995840907097, 0.012890785001218319, -0.01587829552590847, -0.01928863860666752, 0.0011809614952653646, -0.026926854625344276, -0.020252779126167297, -0.010968486778438091, -0.015348547138273716, 0.008559435606002808, -0.009286923334002495, 0.0014621232403442264, 0.03831499442458153, 0.016517579555511475, 0.037184324115514755, -0.041231196373701096, 0.03757374733686447, -0.039465345442295074, -0.04308579862117767, 0.0011091071646660566, -0.029794104397296906, 0.008459310978651047, -0.01713281124830246, -0.016625113785266876, -0.05582521855831146, -0.0415986105799675, 0.028725938871502876, 0.04966316372156143, 0.012718678452074528, -0.025533588603138924, 0.013822318986058235, -5.168768620933406e-05, 0.02616700902581215, -0.06113629788160324, -0.03175340220332146, 0.03593592345714569, -0.04014921560883522, -0.020605407655239105, 0.02186705358326435] -``` \ No newline at end of file diff --git a/docs/ES/2_kibana安装.md b/docs/ES/2_kibana安装.md deleted file mode 100644 index e9c7a31..0000000 --- a/docs/ES/2_kibana安装.md +++ /dev/null @@ -1,51 +0,0 @@ - - - - - -## 1. yum安装 -添加yum仓库。 -Kibana通常不是yum默认仓库的一部分,因此需要添加 Elastic 仓库:: -```shell - -导入 Elastic 签名密钥: -sudo rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch - -添加 Elastic 仓库: -sudo tee /etc/yum.repos.d/elastic.repo < 无效的源发行版: 18 -原因是我们指定的源发行版不匹配Java编译器的版本。 -1. 确保这里配置对了 -sourceCompatibility = JavaVersion.VERSION_18 // 不同版本的es,需要不同版本的java环境,注意修改这里 -targetCompatibility = JavaVersion.VERSION_18 // 不同版本的es,需要不同版本的java环境,注意修改这里 -2. elasticsearch --version 提示ES的java版本是21,因此将以上配置改为21。 为了简化问题,决定回退ES版本,改回8.4.1,这样插件的配置文件都不用改了,直接用8.4.1分支就行。 -3. java版本是1.8,不是18(之前以为1.8就是18,卡在这里大半天)。重新安装jdk18就好了。 -javac -version -javac 1.8.0_362 -# 注意yum里面只到17,没有18,下载jdk18,以rpm方式安装:https://www.oracle.com/java/technologies/javase/jdk18-archive-downloads.html -# 注意如果之前自己手动配置了JAVA_HOME,要把他删掉。 -yum remove java-1.8.0-* (之前yum remove java*,有可能有问题) -rpm -ivh jdk-18.0.2.1_linux-x64_bin.rpm -现在三个的版本就都对了: -javac -version -javac 18.0.2.1 - -[root@192 ~]# elasticsearch --version -warning: ignoring JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk; using bundled JDK -Version: 8.4.1, Build: rpm/2bd229c8e56650b42e40992322a76e7914258f0c/2022-08-26T12:11:43.232597118Z, JVM: 18.0.2 - -gradle --version (gradle用的jdk是1.8 不用管,插件的readme上注明gradle版本7.6匹配ES版本8.4.1) -Gradle 7.6.4 -JVM: 1.8.0_362 - - - diff --git a/docs/ES/3.3_ik分词器.md b/docs/ES/3.3_ik分词器.md deleted file mode 100644 index a353f6d..0000000 --- a/docs/ES/3.3_ik分词器.md +++ /dev/null @@ -1,9 +0,0 @@ - - - - -cd /usr/share/elasticsearch/plugins/ -wget https://release.infinilabs.com/analysis-ik/stable/elasticsearch-analysis-ik-8.18.0.zip -unzip elasticsearch-analysis-ik-8.18.0.zip -d elasticsearch-analysis-ik-8.18.0 -systemctl restart elasticsearch - diff --git a/docs/ES/3_ansj分词插件安装.md b/docs/ES/3_ansj分词插件安装.md deleted file mode 100644 index 8fd8bef..0000000 --- a/docs/ES/3_ansj分词插件安装.md +++ /dev/null @@ -1,97 +0,0 @@ - -https://github.com/NLPchina/elasticsearch-analysis-ansj - - -git clone https://github.com/NLPchina/elasticsearch-analysis-ansj.git -cd elasticsearch-analysis-ansj -git checkout v8.3.3 -mvn package - -会提示编译失败(v8.x版本都会失败,7.x就没问题),错误信息如下: -[ERROR] /ssd/samba_root1/projects/ansj/elasticsearch-analysis-ansj/src/main/java/org/ansj/elasticsearch/plugin/AnalysisAnsjPlugin.java:[14,34] 无法访问org.apache.lucene.analysis.Analyzer -[ERROR] 错误的类文件: /home/hello/.m2/repository/org/apache/lucene/lucene-core/9.2.0/lucene-core-9.2.0.jar(org/apache/lucene/analysis/Analyzer.class) -[ERROR] 类文件具有错误的版本 55.0, 应为 52.0 -[ERROR] 请删除该文件或确保该文件位于正确的类路径子目录中。 - -7.x版本都没问题,8.x就会出这个错误。尝试把jdk版本从1.8改成 11, 17, 18、升级maven版本到3.9.6都不行(又提示类文件具有错误的版本 61.0, 应为 55.0)。 -有人说可能是依赖冲突,不知道是否可以修改下环境,使得不冲突。 - -因此自己编译只能编译v7.17.16。8.x,release里面有现成的版本: -./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-analysis-ansj/releases/download/v8.7.0/elasticsearch-analysis-ansj-8.7.0.0-release.zip - -测试: -kibana中 : GET /_cat/ansj?text=中国&type=index_ansj -或者: -curl -X GET "http://localhost:9200/_cat/ansj?text=中国&type=index_ansj" - - -curl -X GET "http://localhost:9200/_cat/ansj?pretty" -H 'Content-Type: application/json' -d' -{ - "type": "index_ansj", - "text": "中国" -}' - -# 注意事项 -ansj分词如果没有设置停用词的话,空格也会被分出来,搜出来的结果空格也会被飘红(如果query带空格的话)。所以一定要设置停用词表。 - -词性说明: - 附-词性表格 - 符号 词性 解释 - n 名词 取英语名词noun的第1个字母。 - np 人名 - nr 人名 名词代码n和“人(ren)”的声母并在一起。 - nh 人名 - ns 地名 名词代码n和处所词代码s并在一起 - ni 机构名 - nz 其它专名 - nt 机构团体名 “团”的声母为t,名词代码n和t并在一起。 - nl 名词性惯用语 - nd 方位名词 - ng 名词性语素 - b 区别词 - m 数词 取英语numeral的第3个字母,n,u已有他用。 - q 量词 取英语quantity的第1个字母。 - mq 数量词 - t 时间词 取英语time的第1个字母。 - f 方位词 取汉字“方” 的声母。 - s 处所词 取英语space的第1个字母 - v 动词 取英语动词verb的第一个字母。 - vd 副动词 - vn 名动词 - vshi 动词“是” - vyou 动词“有” - vf 趋向动词 - vx 形式动词 - vi 不及物动词(内动词) - vl 动词性惯用语 - vg 动词性语素 - a 形容词 取英语形容词adjective的第1个字母。 - an 名形词 - ad 副形词 - an 名形词 - ag 形容词性语素 - al 形容词性惯用语 - d 副词 取adverb的第2个字母,因其第1个字母已用于形容词。 - h 前接成分 取英语head的第1个字母。 - k 后接成分 - i 成语 取英语成语idiom的第1个字母。 - j 简称 取汉字“简”的声母。 - l 习用语 习用语尚未成为成语,有点“临时性”,取“临”的声母 - r 代词 取英语代词pronoun的第2个字母,因p已用于介词。 - c 连词 取英语连词conjunction的第1个字母。 - p 介词 取英语介词prepositional的第1个字母。 - u 助词 取英语助词auxiliary 的第2个字母,因a已用于形容词。 - ud 结构助词 有 - ug 时态助词 你 - uj 结构助词的 迈向 - ul 时态助词了 完成 - uv 结构助词地 满怀信心 - uz 时态助词着 眼看 - y 语气助词 取汉字“语”的声母。 - e 叹词 取英语叹词exclamation的第1个字母。 - o 拟声词 取英语拟声词onomatopoeia的第1个字母。 - g 语素 绝大多数语素都能作为合成词的“词根”,取汉字“根”的声母。 - w 标点 - x 其它 非语素字只是一个符号,字母x通常用于代表未知数、符号。 - z 状态词 取汉字“状”的声母的前一个字母。 - tg 时语素 时间词性语素。时间词代码为t,在语素的代码g前面置以T。 \ No newline at end of file diff --git a/docs/ES/4_索引和查询测试.md b/docs/ES/4_索引和查询测试.md deleted file mode 100644 index 93b5136..0000000 --- a/docs/ES/4_索引和查询测试.md +++ /dev/null @@ -1,74 +0,0 @@ -# 查询官方文档: -https://link.zhihu.com/?target=https%3A//www.elastic.co/guide/cn/elasticsearch/guide/current/query-dsl-intro.html - - -# 查看配置 -curl "localhost:9200/_nodes/settings?pretty=true" - - -# 测试多字段搜索(支持中文分词): -curl -X GET "localhost:9200/goods/_search" -H 'Content-Type: application/json' -d' -{ - "query": { - "multi_match": { - "query": "玩具", - "fields": ["name^2", "name_zh^2", "sub_name_zh^2", "brand_name_zh^2", "category_name_zh^2"], - "fuzziness": "AUTO" - } - }, - "highlight": { - "fields": { - "name": {}, - "name_zh": {}, - "sub_name_zh": {}, - "brand_name_zh": {}, - "category_name_zh": {} - } - }, - "from": 0, - "size": 10 -}' - -# 测试精确匹配: -curl -X GET "localhost:9200/goods/_search" -H "Content-Type: application/json" -d' -{ - "query": { - "term": { - "goods_id": "2683337" - } - } -}' - - -# 查看索引分词情况: -curl -X GET "http://localhost:9200/goods/_doc/1?pretty" -curl -X GET "http://localhost:9200/goods/_termvectors/1?fields=*&pretty" - -# 如果文档不存在,找出任意一个文档,得到ID: -curl -X GET "http://localhost:9200/goods/_search?size=1&pretty" -# 得到ID后查询termvectors: -curl -X GET "http://localhost:9200/goods/_termvectors/[DOC_ID]?fields=*&pretty" - - -# 测试analyzer: -curl -X GET "http://localhost:9200/goods/_analyze?pretty" -H 'Content-Type: application/json' -d' -{ - "text": "玩具", - "analyzer": "index_ansj" -}' - - - -# 测试向量搜索: -curl -X GET "localhost:9200/goods/_search" -H "Content-Type: application/json" -d' -{ - "query": { - "script_score": { - "query": {"match_all": {}}, - "script": { - "source": "cosineSimilarity(params.query_vector, 'name_prefix') + 1.0", - "params": {"query_vector": [-0.05291186273097992, 0.0274342093616724, -0.016730275005102158, 0.010487289167940617, -0.022640341892838478, -0.048682719469070435, 0.04544096067547798, 0.023079438135027885, 0.007221410982310772, 0.023566091433167458, 0.026696473360061646, 0.08252757787704468, -0.042835772037506104, 0.0009668126585893333, -0.02860398218035698, -0.004426108207553625, -0.002644421299919486, -0.027699561789631844, 0.005749804899096489, -0.04468372091650963, -0.0296687763184309, -0.009487600065767765, 0.020041221752762794, 0.00778265530243516, 0.008522099815309048, 0.03497027978301048, -0.021573258563876152, -0.028293319046497345, -8.54598984005861e-05, -0.03164539486169815, -0.017121458426117897, -0.0006902766763232648, 0.04650883004069328, -0.030234992504119873, -0.010207684710621834, -0.035288386046886444, -0.0047269039787352085, -0.0006454040994867682, -0.056146346032619476, 0.008901881985366344, 0.010757357813417912, -0.013022932223975658, 0.04627145081758499, -0.020669423043727875, -0.02031278982758522, -0.052186835557222366, -0.0148158585652709, -0.018267231062054634, -0.059003304690122604, -0.011793344281613827, 0.027096575126051903, 0.019299808889627457, 0.04161312058568001, -0.019393721595406532, -0.02361445501446724, 0.07711422443389893, -0.02068573422729969, -0.004702702630311251, -0.011135494336485863, 0.0101374052464962, -0.020808257162570953, 0.011924360878765583, -0.020093027502298355, -0.007138500455766916, 0.014727798290550709, 0.05770261213183403, 0.017841406166553497, 0.044339124113321304, -0.01490224339067936, -0.008343652822077274, -0.04842463508248329, 0.0336640290915966, -0.004893577191978693, -0.021536342799663544, -0.032384153455495834, -0.009452177211642265, -0.027460120618343353, -0.009426826611161232, 0.006357531528919935, 0.019494572654366493, 0.009722599759697914, -0.00497430982068181, 0.023032115772366524, 0.05221958085894585, -0.01671120524406433, 0.061740316450595856, -0.06789620220661163, -0.023851843550801277, -0.02249223366379738, -0.01231105625629425, -0.0499565526843071, 0.004251780919730663, 0.05466651916503906, -0.024449756368994713, -0.034151963889598846, 0.037387508898973465, -0.0016276679234579206, -0.02609393745660782, 0.01800747588276863, -0.0028136332985013723, -0.06036405637860298, 0.028903907164931297, 0.006318055558949709, 0.012870929203927517, -0.0021476889960467815, -0.012034566141664982, -0.008372323587536812, 0.024942906573414803, 0.08258169889450073, 0.006757829803973436, 0.032017264515161514, -0.012414710596203804, 0.014826267957687378, -0.040858786553144455, -0.0060302577912807465, 0.00843990221619606, -0.031066348776221275, -0.06313654035329819, 0.0056659989058971405, -0.007768781390041113, 0.011673268862068653, 0.007261875085532665, 0.006112886127084494, -0.07374890148639679, 0.06602894514799118, -0.05385972931981087, -0.0010994652984663844, 0.05939924344420433, 0.015503636561334133, 0.034621711820364, 0.008040975779294968, -0.023962488397955894, -0.06270411610603333, 0.00027893096557818353, -0.0436306893825531, -0.006309020332992077, 0.02416943572461605, -0.015391307882964611, -0.012442439794540405, -0.003181715961545706, -0.0021985983476042747, 0.008671553805470467, 0.004063367377966642, -0.02560708485543728, 0.03469422832131386, -0.04249674826860428, -0.013552767224609852, -0.052823010832071304, 0.014670411124825478, -0.011493593454360962, 0.024076055735349655, 0.056352417916059494, -0.008510314859449863, 0.015936613082885742, 0.003935575485229492, 0.0037949192337691784, 0.015074086375534534, 0.016583971679210663, -0.0057802870869636536, 0.005751866847276688, -0.009386995807290077, -0.03710195794701576, -0.03144300729036331, -0.07106415182352066, -0.003882911056280136, -0.010697683319449425, -0.014338435605168343, 0.007036983501166105, -0.035716522485017776, 0.06593189388513565, 0.007752529811114073, -0.030261363834142685, -0.02513342909514904, -0.039278656244277954, 0.015320679172873497, -0.012659071013331413, 0.014207725413143635, 0.010264124721288681, 0.01617652177810669, -0.022644126787781715, -0.031033707782626152, 0.04160666465759277, -0.05329348146915436, 0.02423500455915928, -0.019389694556593895, 0.008645910769701004, -0.005958682857453823, -0.03648180514574051, 0.011972597800195217, 0.037404924631118774, -0.007001751102507114, -0.05138246342539787, 0.0013400549069046974, -0.03268183395266533, 0.07687076926231384, -0.02033335529267788, -0.020667986944317818, 0.0038236891850829124, 0.029960744082927704, 0.015430699102580547, 0.05047214776277542, 0.0052254535257816315, 0.013995353132486343, -0.031164521351456642, -0.014291719533503056, 0.015829795971512794, -0.0013409113744273782, -0.044300951063632965, 0.045415859669446945, -0.005037966184318066, -0.03883415088057518, 0.027200160548090935, 0.008182630874216557, -0.046456750482320786, -0.029778052121400833, 0.02067168429493904, -0.006381513085216284, -0.04693000763654709, 0.009974686428904533, 0.03109011799097061, -0.012696364894509315, 0.030124813318252563, 0.02372679114341736, 0.06566771119832993, 0.03553507477045059, -0.032816141843795776, 0.028003521263599396, 0.06498659402132034, -0.013530750758945942, 0.0312667116522789, -0.015660811215639114, -0.00776742585003376, -0.004829467739909887, -0.015968922525644302, 0.04765664413571358, -0.0026502758264541626, 0.01891564577817917, 0.04119837284088135, 0.012158435769379139, 0.008338023908436298, -0.006039333995431662, 0.0630166307091713, -0.02758428454399109, 0.029347822070121765, -0.030129415914416313, 0.023165738210082054, 0.04064684361219406, 0.04446929693222046, -0.006133638322353363, -0.013095719739794731, -0.041152223944664, -0.01038535125553608, 0.01738007925450802, 0.0010595708154141903, -0.055003564804792404, 0.036829687654972076, -0.030270753428339958, -0.009607627056539059, 0.014103117398917675, 0.005140293389558792, 0.032931022346019745, 0.026972685009241104, -0.00039128100615926087, 0.00550195062533021, 0.062454141676425934, 0.02344602160155773, -0.01688288524746895, 0.011600837111473083, 0.009648085571825504, 0.012827200815081596, 0.02368510514497757, -0.044808436185121536, 0.006574536208063364, 0.03677171841263771, 0.021754244342446327, -0.0031720376573503017, -0.03498553857207298, -0.027119319885969162, 0.05196662247180939, 0.0063033513724803925, -0.002766692778095603, -0.03879206255078316, -0.005737128667533398, -0.02351462095975876, 0.04338989034295082, -0.03623301535844803, 0.003727369010448456, 0.044172726571559906, 0.06180792301893234, -0.025736358016729355, 0.01280374638736248, -0.01768171414732933, 0.0413120836019516, 0.036350950598716736, 0.020034022629261017, -0.00938474852591753, -0.04920303076505661, -0.1626604050397873, 0.0016566020203754306, -0.010797491297125816, 0.0037245014682412148, 0.039030417799949646, -0.009399985894560814, 0.016659803688526154, -0.047097429633140564, -0.00987484585493803, 0.020634479820728302, 0.005361238028854132, -0.05283225327730179, 0.002501025330275297, -0.004766151309013367, 0.00850654486566782, -0.0050267502665519714, -0.046555373817682266, 0.012670878320932388, 0.0018581973854452372, -0.010647253133356571, 0.01990092545747757, 0.02013244479894638, 0.04490885138511658, 0.029433563351631165, -0.01408607978373766, 0.029722925275564194, 0.04512600228190422, -0.04305345192551613, 0.0053901285864412785, -0.010685979388654232, 0.01516974437981844, 0.02340293675661087, -0.014181641861796379, -0.0013334851246327162, 0.020624764263629913, 0.06469231843948364, 0.016654038801789284, -0.043994754552841187, 0.025707466527819633, -0.004160136915743351, 0.021129926666617393, 0.041262850165367126, 0.006293899845331907, 0.056005991995334625, -0.006883381400257349, -0.07502268254756927, -0.02920101210474968, -0.019043054431676865, 0.00737513042986393, 0.013621360063552856, -0.02504715882241726, -0.01138006430119276, -0.010744514875113964, -0.02502342313528061, -0.03335903584957123, 0.012180354446172714, -0.03276645019650459, 0.05202409625053406, 0.03246080502867699, 0.03068908303976059, -0.029587913304567337, -0.04850265011191368, -0.006388102192431688, -0.03203853219747543, -0.050761956721544266, -0.021925227716565132, 0.036384399980306625, -0.011895880103111267, -0.007408954203128815, -0.012625153176486492, 0.0024322718381881714, -0.012196220457553864, -0.007011729292571545, -0.0337890200316906, -0.030034994706511497, 0.04638829082250595, -0.028362803161144257, -0.01176459901034832, 0.00956833828240633, -0.12054562568664551, -0.020540419965982437, 0.014624865725636482, -0.025515791028738022, -0.005027926992624998, -0.03586679324507713, -0.05585843697190285, -0.01700599677860737, -0.00044939795043319464, 0.029278729110956192, 0.25503888726234436, -0.024952411651611328, 0.005794796161353588, -0.007252118084579706, 0.03397773951292038, -0.0030146583449095488, -0.016645856201648712, -0.0008194005931727588, 0.02789629064500332, -0.039116114377975464, -0.035631854087114334, 0.04917449131608009, -0.006455820053815842, -0.011818122118711472, -0.00958359707146883, 0.013176187872886658, 0.037286531180143356, 0.022334400564432144, 0.05832865461707115, 0.010104321874678135, -0.04915979504585266, -0.022671189159154892, -0.016606582328677177, -0.007431587669998407, 0.0025214774068444967, -0.038979604840278625, 0.014895224012434483, 0.03583076596260071, 0.0006473385728895664, 0.04958082735538483, -0.017827684059739113, 0.015710417181253433, 0.062094446271657944, -0.014381879940629005, 0.0002880772517528385, 0.004948006477206945, -8.711735063116066e-06, -0.0029445397667586803, -0.044325683265924454, 0.047702621668577194, -0.03197811171412468, -0.02109563909471035, 0.03041824884712696, 0.021582895889878273, -0.004118872340768576, -0.025784745812416077, 0.06275995075702667, 0.006879465654492378, 0.04185185581445694, 0.02031264826655388, -0.02274201810359955, -0.009617358446121216, -0.04315454140305519, -0.033287111669778824, -0.025126483291387558, -0.003923895303159952, -0.041508499532938004, -0.0009355457150377333, -0.033565372228622437, 0.02229289337992668, -0.0026574484072625637, -0.0028596664778888226, -0.02223617024719715, -0.016868866980075836, 0.04172029718756676, 0.0014162511797621846, -0.037737537175416946, -0.010155809111893177, -0.010357595980167389, 0.04541466012597084, 0.03563382104039192, -0.019189776852726936, -0.012577632442116737, -0.013781189918518066, 0.026566311717033386, 0.020911909639835358, 0.02781282551586628, 0.053938526660203934, 0.0194545891135931, 0.0015139722963795066, -0.0357731431722641, -0.005088387057185173, 0.004257760010659695, 0.04332628846168518, -0.012149352580308914, -0.04734082147479057, 0.018029984086751938, -0.01322091929614544, -0.059820450842380524, -0.03677783161401749, -0.006745075341314077, -0.02209635078907013, -0.012663901783525944, -0.0059855030849576, 0.016270749270915985, -0.00725028058513999, 0.03019685670733452, 0.010252268984913826, -0.06314245611429214, -0.005512078758329153, -0.016377074643969536, -0.0014438428916037083, 0.029021194204688072, -0.015355946496129036, 0.02559172362089157, -0.04241044819355011, 0.010147088207304478, -0.016036594286561012, 0.023162752389907837, 0.047236304730176926, 0.0166736152023077, 0.01226564310491085, -0.015224735252559185, -0.01298521552234888, -0.008012642152607441, 0.028470756486058235, -0.013741613365709782, 0.019896863028407097, 0.01720179058611393, 0.01571199856698513, 0.030143165960907936, -0.02969514951109886, 0.014739652164280415, -0.01854291744530201, -0.045576371252536774, -0.04516203701496124, 0.02147211693227291, 0.007073952350765467, 0.008106761611998081, -0.01828523352742195, 0.002731812885031104, -0.04545339569449425, 0.019007619470357895, 0.03504781052470207, 0.037705861032009125, -0.0045634908601641655, 0.0070000626146793365, 0.0037205498665571213, 0.005224148277193308, -0.017060590907931328, -0.04246727377176285, -0.006265614647418261, -0.015374364331364632, -0.03380871191620827, -0.005029333755373955, 0.007065227720886469, 0.003886009333655238, 0.008613690733909607, -0.012133199721574783, 0.005556005053222179, -0.021959641948342323, 0.04834386706352234, 0.03787781298160553, -0.057815466076135635, 0.015909207984805107, -0.03855409845709801, 0.0018244135426357388, 0.04186264052987099, -0.054983459413051605, 0.006219237111508846, 0.03494301065802574, 0.023722950369119644, 0.0312604121863842, 0.05597991123795509, -0.030345493927598, 0.016615940257906914, -0.0207205917686224, 0.055960651487112045, -0.012713379226624966, -0.0261109359562397, 0.014332456514239311, -0.017245708033442497, -0.06636268645524979, 0.00592504907399416, 0.04649018123745918, -0.018362276256084442, 0.009620632976293564, -0.0044480785727500916, -0.0014729035319760442, 0.015621249563992023, 0.0367378331720829, -0.011857259087264538, -0.045088741928339005, 0.0006832792423665524, 0.02601524256169796, -0.02120809443295002, 0.018104318529367447, 0.008069046773016453, 0.013658273033797741, 0.004183551296591759, -0.04133244603872299, 0.05436890944838524, 0.009334285743534565, -0.014695074409246445, -0.011054124683141708, 0.009796642698347569, -0.008759389631450176, -0.06399217247962952, -0.0028859861195087433, -0.008736967109143734, -0.003506746841594577, 0.008123806677758694, 0.008794951252639294, -0.02940259501338005, 0.009597218595445156, -0.02197900228202343, -0.02082076109945774, 0.023915970697999, -0.059058744460344315, -0.010253551416099072, 0.024443935602903366, -0.029604850336909294, 0.008135135285556316, 0.03568771481513977, -0.017330091446638107, -0.003135789418593049, 0.035103678703308105, 0.0370408296585083, -0.01022601593285799, -0.045891791582107544, 0.01726667769253254, -0.008570673875510693, 0.015297998674213886, -0.015412220731377602, -0.01425748411566019, 0.031544867902994156, 0.013110813684761524, -0.057211123406887054, -0.0008968000765889883, 0.001981658162549138, -0.002101168967783451, -0.09516698867082596, -0.034693196415901184, 0.011157260276377201, 0.010063023306429386, -0.02550840750336647, 0.009959851391613483, 0.022281678393483162, -0.03908146917819977, 0.02196437120437622, 0.03520793840289116, -0.06856158375740051, -0.004901218693703413, 0.1122148334980011, -0.01498009730130434, 0.03165500983595848, -0.07618033140897751, -0.014297851361334324, 0.02150021120905876, 0.005999598652124405, -0.013493427075445652, 0.013868110254406929, 0.00079053093213588, 0.006475066766142845, 0.000955471652559936, -0.03403160721063614, -0.02295752801001072, 0.0041635241359472275, -0.03955964744091034, -0.04943346977233887, 0.00032474088948220015, 0.039174411445856094, -0.011974001303315163, 0.008057610131800175, 0.03809700161218643, -0.041719768196344376, 0.037615906447172165, -0.035932306200265884, 0.008293192833662033, -0.03261689469218254, -0.023902395740151405, -7.811257091816515e-05, -0.011328466236591339, -0.026476409286260605, 0.055370282381772995, 0.03128054738044739, -0.014991461299359798, 0.017835773527622223, 0.01642710715532303, 0.029273470863699913, -0.012139911763370037, 0.01371818222105503, -0.013113478198647499, -0.04071088507771492, 0.0233455840498209, -0.019497444853186607, -0.01747158169746399, 0.02493683062493801, 0.024074571207165718, -0.03614620864391327, -0.025289475917816162, -0.04030011221766472, -0.046772539615631104, 0.009969661012291908, 0.003724620910361409, 0.007474626414477825, -0.04855594411492348, 0.04697829484939575, 0.010695616714656353, 0.027944304049015045, -0.003937696572393179, -0.011591222137212753, -0.011533009819686413, 0.03215765953063965, -0.04699324443936348, -9.356102236779407e-05, -0.01535400003194809, -0.010238519869744778, 0.002703386126086116, 0.04759520664811134, 0.0074842446483671665, -0.04050430282950401, -0.028402622789144516, -0.03205197677016258, 0.011288953013718128, 0.006053865421563387, 0.04641448333859444, 0.005652922671288252, -0.018560705706477165, 0.02581481821835041, 0.00962467584758997, -0.017888177186250687, -0.026476262137293816, -0.005547264125198126, 0.012222226709127426, -0.004069746006280184, -0.020438821986317635, 0.01929863728582859, -0.0053736320696771145, 0.02221786603331566, -0.007175051141530275, 0.003961225971579552, -0.012380941770970821, -0.0040277824737131596, 0.009086307138204575, 0.012202796526253223, 0.018483169376850128, 0.017530532553792, 0.0422886498272419, 0.04987001419067383, 0.003722204128280282, 0.06421508640050888, -0.016258088871836662, -0.027659112587571144, 0.004458434879779816, -0.02898143045604229, -0.014475414529442787, 0.032039571553468704, -0.025734663009643555, -0.01585981249809265, 0.04900333285331726, -0.06422552466392517, -0.0007134959450922906, -0.04035528376698494, 0.03290264680981636, -0.0018848407780751586, 0.0068516512401402, 0.00032433189335279167, -0.002669606124982238, -0.017596688121557236, -0.026878179982304573, 0.014075388200581074, 0.020072080194950104, -0.00295435544103384, -0.01918656937777996, -0.007689833641052246, 0.039347097277641296, 0.0026605715975165367, 0.011779646389186382, 0.04189120978116989, -0.03846775367856026, -0.01993645168840885, 0.04546443000435829, 0.05682912468910217, -0.012384516187012196, -0.004507445730268955, 0.007476931903511286, -0.01160018052905798, 0.006559243891388178, 0.04354899004101753, 0.006185194011777639, 0.028355205431580544, -0.006518798414617777, -0.029528537765145302, 0.06740271300077438, -0.052158474922180176, 0.0025031850673258305, -0.005957300774753094, 0.00500349560752511, 0.022637680172920227, -0.0027129461523145437, -0.011677206493914127, -0.042732879519462585, -0.0021236639004200697, -0.1499215066432953, 0.02914350852370262, -0.031246500089764595, -0.027244996279478073, -0.006904688663780689, 0.01088196225464344, 0.01271661464124918, -0.0430884025990963, -0.020760131999850273, -0.006593034137040377, -0.0007962957606650889, -0.031729113310575485, 0.052976224571466446, -0.03149586543440819, 0.0392388291656971, 0.023318620398640633, -0.01383691094815731, 0.02858218550682068, 0.023135144263505936, 0.026421336457133293, 0.00027594034327194095, -0.03901490569114685, 0.008533132262527943, -0.03802476078271866, -0.011105065234005451, -0.028275510296225548, 0.04846742004156113, 0.021237077191472054, -0.027375172823667526, -0.02717825025320053, -0.031243441626429558, -0.021638689562678337, 0.024066096171736717, 0.05689090117812157, -0.04352620989084244, 0.03599394112825394, 0.05153508856892586, 0.002263782313093543, 0.047110624611377716, 0.006084555760025978, 0.003244618885219097, -0.0015037712873890996, 0.027960799634456635, -0.013650861568748951, 0.03281615301966667, 0.012363187968730927, 0.02162906341254711, -0.010951842181384563, -0.02786285988986492, 0.03754381462931633, 0.01957041770219803, -0.017010418698191643, -0.008339766412973404, 0.0755641758441925, 0.023412147536873817, -0.005748848430812359, -0.05465301498770714, -0.02190011739730835, 0.0054182386957108974, 0.032733004540205, -0.05342638120055199, 0.009907999075949192, -0.02370712347328663, -0.015652501955628395, -0.011254304088652134, -0.019827252253890038, -0.021032121032476425, -0.02607329562306404, -0.0008710312540642917, -0.06800976395606995, -0.017296750098466873, 0.015312970615923405, -0.015649013221263885, -0.016449443995952606, -0.012058117426931858, 0.002104945247992873, 0.020476385951042175, 0.014795565977692604, -0.02145536057651043, -0.028734024614095688, -0.041212357580661774, -0.008211270906031132, 0.033569078892469406, -0.0033273063600063324, -0.02339683100581169, 0.0421740785241127, -0.009677124209702015, -0.006869456730782986, -0.016001028940081596, 0.029614608734846115, -0.06062136963009834, -0.011824233457446098, 0.012096629478037357, -0.028248939663171768, -0.03703905642032623, 0.012119539082050323, -0.041021380573511124, 0.01975782960653305, -0.028443211689591408, 0.020459437742829323, 0.0073023103177547455, -0.06498327851295471, -0.004016770515590906, 0.06460512429475784, -0.053343966603279114, 0.03865537419915199, -5.4113028454594314e-05, -0.008642046712338924, -0.009384138509631157, -0.037736788392066956, -0.035090748220682144, 0.018596891313791275, -0.008763385005295277, 0.040228284895420074, 0.03811536356806755, -0.034618355333805084, -0.004665717948228121, 0.04813361540436745, -0.004303373862057924, 0.00795511994510889, -0.017838604748249054, 0.00563138909637928, -0.03171280398964882, -0.0259436946362257, 0.004301885142922401, -0.02739236131310463, 0.03270035237073898, 0.009064823389053345, -0.0363747663795948, 0.02325567975640297, 0.03453107923269272, -0.012906554155051708, 0.028347544372081757, 0.01234712265431881, 0.030589573085308075, 0.0024874424561858177, -0.0173872709274292, 0.0247347354888916, 0.004171399865299463, 0.02350561134517193, -0.05499064922332764, -0.023146219551563263, -0.012485259212553501, -0.0228674728423357, 0.013267520815134048, 0.021304689347743988, -0.018937893211841583, -0.0260267723351717, -0.022532619535923004, 0.0030378480441868305, -0.008528024889528751, -0.030528495088219643, -0.009305189363658428, -0.0074027362279593945, -0.020641637966036797, 0.006984233390539885, 0.04300186410546303, -0.033014994114637375, -0.006089311558753252, 0.04753036051988602, -0.036625705659389496, -0.04691743850708008, -0.007467558141797781, 0.0652017593383789, -0.03861508145928383, -0.00741452956572175, 0.003471594536677003, 0.016132064163684845, 0.01570185460150242, 0.018733495846390724, -0.019025148823857307, 0.003490244736894965, -0.017714614048600197, -0.003447450464591384, 0.015267218463122845, 0.015076974406838417, -0.002631498035043478, 0.005311752203851938, 0.014075293205678463, 0.0026123111601918936, 0.011874910444021225, 0.0714355856180191, 0.06941138952970505, 0.022251378744840622, 0.01972009800374508, 0.04719123989343643, 0.023544959723949432, 0.017852554097771645, 0.01843070052564144, -0.05294886603951454, -0.008682304993271828, 0.010625398717820644, 0.0428495928645134, 0.002173527143895626, 0.06291069090366364, 0.024296458810567856, 0.008714474737644196, 0.06520587205886841, 0.015627536922693253, 0.04247526824474335, 0.0009774811333045363, 0.00738496845588088, -0.024803027510643005, 0.013228596188127995, -0.037615202367305756, -0.028807995840907097, 0.012890785001218319, -0.01587829552590847, -0.01928863860666752, 0.0011809614952653646, -0.026926854625344276, -0.020252779126167297, -0.010968486778438091, -0.015348547138273716, 0.008559435606002808, -0.009286923334002495, 0.0014621232403442264, 0.03831499442458153, 0.016517579555511475, 0.037184324115514755, -0.041231196373701096, 0.03757374733686447, -0.039465345442295074, -0.04308579862117767, 0.0011091071646660566, -0.029794104397296906, 0.008459310978651047, -0.01713281124830246, -0.016625113785266876, -0.05582521855831146, -0.0415986105799675, 0.028725938871502876, 0.04966316372156143, 0.012718678452074528, -0.025533588603138924, 0.013822318986058235, -5.168768620933406e-05, 0.02616700902581215, -0.06113629788160324, -0.03175340220332146, 0.03593592345714569, -0.04014921560883522, -0.020605407655239105, 0.02186705358326435]} - } - } - } -}' diff --git a/docs/ES/ES_8.18/1_ES安装.md b/docs/ES/ES_8.18/1_ES安装.md new file mode 100644 index 0000000..8bde5e9 --- /dev/null +++ b/docs/ES/ES_8.18/1_ES安装.md @@ -0,0 +1,103 @@ + + + +## 一、安装 +### 1. 安装 +```shell +# 参考install_elasticsearch.sh。 + +ELASTICSEARCH_VERSION="8.18.0" + +wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo rpm --import +yum install -y https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$ELASTICSEARCH_VERSION-x86_64.rpm + +# 设置Elasticsearch的系统服务 +systemctl daemon-reload +systemctl start elasticsearch +systemctl enable elasticsearch +``` +安装、配置好后验证命令: curl -X GET "http://localhost:9200" + + +### 3. 工程&安全方面设置 + +性能相关配置: +```shell +vi /etc/elasticsearch/jvm.options +堆内存大小: +-Xms32g +-Xmx32g +``` + +/etc/elasticsearch/elasticsearch.yml : + +Fielddata Cache(用于聚合和排序操作): +indices.fielddata.cache.size: 40% # 将 fielddata 缓存大小设置为 40% 的物理内存 +Query Cache(用于查询缓存): +indices.queries.cache.size: 30% # 将查询缓存设置为 30% 的物理内存 + +修改的系统配置: +vi /etc/sysctl.conf +```shell +# tangwang +# 调整系统句柄限制 +fs.file-max = 1000000 +# 优化文件描述符 可以分配的vma数量 +vm.max_map_count = 655360 +# 优化脏内存页,es写入削峰 +vm.dirty_ratio=10 +vm.dirty_background_ratio=5 +vm.dirty_writeback_centisecs=200 +# 优化系统回收inode cache权重 +vm.vfs_cache_pressure=200 +vm.dirty_expire_centisecs=6000 +# 尽可能低的使用swap,内存很充裕可以设置为0,较低设置为1 +vm.swappiness=0 +``` +vi /etc/security/limits.conf +```shell +# tangwang 修改 下面都加了10倍 +# End of file +* soft nofile 655350 +* hard nofile 655350 +root soft nofile 655350 +root hard nofile 655350 +* soft nofile 655350 +* hard nofile 655350 + + +# tangwang 补充下面的 +* soft nproc 102400 +* hard nproc 409600 +# 允许进程锁定内存 +* soft memlock unlimited +* hard memlock unlimited +``` + + +### TOOD : +配置为单节点模式,discovery.type: single-node 但是还需要其他配套改动。 + +用户名 密码 安全方面 +kibana用户名密码 + +## 其他说明 +ES 8.x版本特性 +在 8.0版本 中,提供新的kNN 搜索 API。以前,Elasticsearch 仅支持使用script_score带有向量函数的查询进行精确的 kNN 搜索。虽然此方法可以保证准确的结果,但它通常会导致搜索速度缓慢,并且无法很好地适应大型数据集。作为索引速度较慢和准确性不完美的代价,新的 kNN 搜索 API 允许您以更快的速度对更大的数据集运行近似 kNN 搜索。 + +在 8.4版本中,把knn搜索加入到search API中,以支持 ANN 搜索。它由与旧 _knn_search端点相同的 Lucene ANN 功能提供支持。该knn选项可以与其他搜索功能(例如查询和聚合)结合使用。 + +在 8.7版本中,允许多个 KNN 搜索子句。某些向量搜索场景需要使用几个 kNN 子句进行相关性排名,例如,当基于多个字段进行排名时,每个字段都有自己的向量,或者当文档包含图像向量和文本向量时。用户可能希望获得基于所有这些 kNN 子句的组合的相关性排名。 + +在 8.8版本 中,将 Introducing Elastic Learned Sparse Encoder: Elastic’s AI model for semantic search — Elastic Search Labs 模型引入到我们的机器学习模型库中,您可以开箱即用。ELSER 通过启用语义搜索来提高搜索结果的相关性。这种搜索方法考虑单词的含义,而不是仅仅依赖字面术语。ELSER 是一种预训练的域外稀疏向量模型,无需对特定源数据进行微调。它从一开始就为您提供相关的搜索结果。并且在此版本中,还提升了KNN检索语法,加入了similarity参数,允许过滤给定相似性之外的最近邻结果。 + +在8.9版本中。text_embedding query_vector_builderkNN 搜索的扩展普遍可用。 + +在8.10版本中,启用跨段并行 knn 搜索,使得 knn 查询对由多个段组成的分片更快,来优化knn搜索的性能。 + + + + + +8.15 更为丰富的工具用于微调相关性、更高的模型灵活性、矢量搜索的改进 + diff --git a/docs/ES/ES_8.18/1_ES配置和使用.md b/docs/ES/ES_8.18/1_ES配置和使用.md new file mode 100644 index 0000000..569f12f --- /dev/null +++ b/docs/ES/ES_8.18/1_ES配置和使用.md @@ -0,0 +1,680 @@ +# Elasticsearch 文档 + +## 相关链接 +- 接口文档:http://rap.essa.top:88/workspace/myWorkspace.do?projectId=78#2187 +- Kibana 控制台:http://120.76.41.98:5601/app/dev_tools#/console/shell + +## 分词方面 + +Ansj 分词插件安装 +ES可以用的中文分词,效果最好的是hanLP和ansj,其次是jieba。 + +我们老的搜索 solr 已经在几年前替代掉了ik,使用的是mmseg。但是我没找到mmseg的ES插件。 + +为了分词方面不至于比老版本差,这里先安装了ansj + +### 1. 下载插件 +从 [elasticsearch-analysis-ansj releases](https://github.com/NLPchina/elasticsearch-analysis-ansj/releases) 选择对应版本下载: + +- ES 8.18 版本: +```bash +wget https://github.com/NLPchina/elasticsearch-analysis-ansj/archive/refs/tags/v8.18.0.zip +``` + +- ES 8.17 版本: +```bash +wget https://github.com/NLPchina/elasticsearch-analysis-ansj/archive/refs/tags/v8.17.6.zip +``` + +### 2. 编译 +执行 `mvn package` 命令,编译成功后将在 `target/releases/` 目录生成插件压缩包: +`elasticsearch-analysis-ansj-<版本号>-release.zip` + +### 3. 安装步骤 +1. 进入 ES 安装路径(默认:`/usr/share/elasticsearch/`) +2. 执行安装命令: +```bash +bin/elasticsearch-plugin install file:///xxx/绝对路径到/elasticsearch-analysis-ansj-8.18.0.0-release.zip +``` +3. 重启服务: +```bash +systemctl restart elasticsearch +``` + +其他分词插件安装方法: +《3.1_hanlp安装.md》 +《3.2_jieba插件安装.md》 +在ES8上面安装过,但是没试过具体的版本 8.17 8.18 + +### 4. 配置说明 +停用词、同义词配置位于 `/config/elasticsearch-analysis-ansj/ansj.cfg.yml`(暂未使用) + +## 字段说明 + +```bash +需要的字段: +id 商品skuId +goods_id 商品spuId +buyer_id 所属专属采购商id +trader_buyer_ids 所属贸易商名下平台客户的专属采购商id +goods_certification_types 商品证书类型 +supplier_code 供应商编码 +supplier_name 供应商名称 +supplier_certification_code 供应商企业证书编码(列表) +auth_buyer_level_list 商品可见采购商等级(集合) +show_price_level_list 价格可见采购商等级(集合) +goods_composition 成分列表(材质) +compositions_main_secondary 物料主副(主:1,副:2),格式:物料代码_主副类型 +goods_key_word_zh 商品关键词中文 +goods_key_word_en 商品关键词英文 +goods_key_word_ru 商品关键词俄文 +goods_copyright 版权(自有、第三方、无授权、A货) +goods_main_material 主材质(字典:材质) +is_in_new_protect 是否在新品保护期(0否,1是) +goods_new_protect_date_stamp 新品保护期日期时间戳 +goods_attribute_name_zh spu属性中文(列表) +goods_attribute_name_en spu属性英文(列表) +goods_attribute_name_ru spu属性俄文(列表) +purchase_moq 采购MOQ +ts 触发索引的时间 +deliver_day 货期 +factory_no 工厂货号 +factory_no_buyer 工厂货号(客户) +fir_on_sell_time 首次上架时间 +fir_on_sell_time_stamp 首次上架时间timestamp +no 商品编码 +hs_no 宏升编码 +package_type 包装类型值(来自商品属性编码:PKG) +package_type_id 包装类型ID(来自商品属性编码:PKG) +labelId_by_skuId_essaone_* essaone商品标签,国家编码标识 +sale_goods_certificate_* 商品证书ID,国家编码标识 +labelId_by_skuId_essa_* essa商品标签,区域ID标识 +``` + +## Mapping 配置 +参考文件 `create_index.sh`: + +## 快速入门 + +### Shell +参考 [索引和查询测试](../docs/3.3_索引和查询测试.md) 包含了在ES服务器进行本地进行一些常用的查询操作。 + +### Python +- [test_index_and_search.py](../tests/test_index_and_search.py) 是一个简单的例子,创建索引,导入数据,查询数据 +- [batch_bulk_goods.py](../batch_bulk_goods.py) 功能是 通过sql 读取最近3年的所有数据,按batch(1000)通过bulk接口进行逐批入库,入库到goods索引。 + +### Kibana + +#### 分词相关 +```bash +# 索引分词 +GET /_cat/ansj?text=14寸第4代真眼珠实身冰雪公仔带手动大推车,搪胶雪宝宝&type=index_ansj + +# 查询分词 +GET /_cat/ansj?text=14寸第4代真眼珠实身冰雪公仔带手动大推车,搪胶雪宝宝&type=query_ansj + +# 查看配置 +GET /_cat/ansj/config +``` +#### 查询相关 +GET /goods/_search +{ + "query": { + "match_all": {} + }, + "size": 5 +} + +#### 1. 查看字段分词结果 +```bash +# 查看中文名称分词结果 +GET /_cat/ansj?text=14寸第4代真眼珠实身冰雪公仔带手动大推车&type=index_ansj + +# 查看英文名称分词结果 +GET /_cat/ansj?text=14 inch 4th generation real eye snow doll with manual cart&type=standard +``` + +#### 2. 查看索引随机10条内容 +```bash +GET /goods/_search +{ + "size": 10, + "query": { + "function_score": { + "query": { "match_all": {} }, + "random_score": {} + } + } +} +``` + +#### 3. 关键词查询 +```bash +# 简单关键词匹配 +GET /goods/_search +{ + "query": { + "match": { + "name_zh": "冰雪公仔" + } + } +} + +# 多字段关键词匹配 +GET /goods/_search +{ + "query": { + "multi_match": { + "query": "冰雪公仔", + "fields": ["name_zh", "sub_name_zh", "category_name_zh"] + } + } +} +``` + +#### 4. 向量查询 +```bash +# 使用向量相似度查询 +GET /goods/_search +{ + "query": { + "script_score": { + "query": { "match_all": {} }, + "script": { + "source": "cosineSimilarity(params.query_vector, 'name_prefix') + 1.0", + "params": { + "query_vector": [0.1, 0.2, ...] # 1024维向量 + } + } + } + } +} +``` + +#### 5. SKUID查询 +```bash +# 精确匹配SKUID +GET /goods/_search +{ + "query": { + "term": { + "goods_id": "2817667" + } + } +} +``` + +#### 6. 名称查询测试 +```bash +# 中文名称模糊匹配 +GET /goods/_search +{ + "query": { + "match": { + "name_zh": { + "query": "冰雪公仔", + "fuzziness": "AUTO" + } + } + } +} + +# 英文名称匹配 +GET /goods/_search +{ + "query": { + "match": { + "name_en": "snow doll" + } + } +} + +# 俄语名称匹配 +GET /goods/_search +{ + "query": { + "match": { + "name_ru": "снежная кукла" + } + } +} + +# 使用 match_phrase 进行短语匹配 +GET /goods/_search +{ + "query": { + "match_phrase": { + "name_zh": "冰雪公仔" + } + } +} + +# 使用 match_phrase 进行多语言短语匹配 +GET /goods/_search +{ + "query": { + "bool": { + "should": [ + { + "match_phrase": { + "name_zh": "冰雪公仔" + } + }, + { + "match_phrase": { + "name_en": "snow doll" + } + }, + { + "match_phrase": { + "name_ru": "снежная кукла" + } + } + ], + "minimum_should_match": 1 + } + } +} + +# 使用 match_phrase 配合 slop 参数进行模糊短语匹配 +GET /goods/_search +{ + "query": { + "match_phrase": { + "name_zh": { + "query": "冰雪公仔", + "slop": 2 + } + } + } +} + +# 多语言 match_phrase 配合 slop 参数 +GET /goods/_search +{ + "query": { + "bool": { + "should": [ + { + "match_phrase": { + "name_zh": { + "query": "冰雪公仔", + "slop": 2 + } + } + }, + { + "match_phrase": { + "name_en": { + "query": "snow doll", + "slop": 1 + } + } + }, + { + "match_phrase": { + "name_ru": { + "query": "снежная кукла", + "slop": 2 + } + } + } + ], + "minimum_should_match": 1 + } + } +} +``` + +#### 7. 多语言查询测试 +```bash +# 同时查询中英文名称 +GET /goods/_search +{ + "query": { + "bool": { + "should": [ + { + "match": { + "name_zh": "冰雪公仔" + } + }, + { + "match": { + "name_en": "snow doll" + } + } + ], + "minimum_should_match": 1 + } + } +} +``` + +#### 8. 向量索引查询测试 +注意:向量查询中的向量维度必须与索引中定义的维度匹配(1024维) +```bash +# 使用向量相似度进行商品推荐 +GET /goods/_search +{ + "query": { + "script_score": { + "query": { "match_all": {} }, + "script": { + "source": "cosineSimilarity(params.query_vector, 'ru_name') + 1.0", + "params": { + "query_vector": [0.1, 0.2, ...] # 1024维向量 + } + } + } + }, + "size": 10 +} +``` + +#### 9. 关键词+向量索引组合查询测试 +```bash +# 关键词搜索+向量相似度提权 +GET /goods/_search +{ + "query": { + "function_score": { + "query": { + "match": { + "name_zh": "冰雪公仔", + "boost": 1.0 + } + }, + "functions": [ + { + "script_score": { + "script": { + "source": "cosineSimilarity(params.query_vector, 'name_prefix') + 1.0", + "params": { + "query_vector": [0.1, 0.2, ...] # 1024维向量 + } + } + } + } + ], + "boost_mode": "multiply" + } + } +} + +# source 可以支持embedding为空 : "source": "doc['embedding'].isEmpty() ? 1.0 : dotProduct(params.query_vector, 'embedding') + 1.0", + +两者乘起来: +{ + "query": { + "function_score": { + "score_mode": "sum", + "boost_mode": "multiply", + "query": { + "match": { + "content": { + "query": keywords, + "boost": 1.0 + } + } + }, + "functions": [ + { + "script_score": { + "script": { + "source": "doc['embedding'].isEmpty() ? 1.0 : dotProduct(params.query_vector, 'embedding') + 1.0", + "params": {"query_vector": context.embeddings[0][1]} + } + } + } + ] + } + } + } + +#### 9. 向量搜索+关键词搜索 +GET /goods/_search +{ + "query": { + "match": { + "content": { + "query": "玩具", + "boost": 1.0 + } + } + }, + "knn": { + "field": "name_prefix", + "query_vector": [-0.05291186273097992, ...], + "k": 5, + "num_candidates": 10, + "boost": 1.0 + } + } + + + + +参考代码: +```python + def execute_search(self, context, search_type="match_phrase", search_type_attachment=0, size=10): + query = context.query + normalized_query = context.normalized_query + core_term = context.core_term + keywords = context.keywords + knn_boost_keywords = core_term if core_term else keywords + expand = context.expand + + seen_queries = set() + unique_queries = [] + for q, weight in [(query, 1.0), (normalized_query, 1.0), (keywords, 0.5)]: + if q and q not in seen_queries: + unique_queries.append((q, weight)) + seen_queries.add(q) + + # 关于混合检索: + # knn和文本查询同时作用: + # 8.12之前query里面不能包含knn,kNN搜索作为查询已在 8.12 版本中引入: https://www.elastic.co/search-labs/blog/knn-query-elasticsearch + # { + # "size": 3, + # "query": { + # "bool": { + # "should": [ + # { + # "knn": { + # "field": "embedding", + # "query_vector": [2,2,2,0], + # "num_candidates": 10, + # "_name": "knn_query" + # } + # }, + # { + # "match": { + # "description": { + # "query": "luxury", + # "_name": "bm25query" + # } + # } + # } + # ] + # } + # + # knn里面不能包含query。 + # knn和query并列(hybrid search 混合检索),是求或的关系。 + # knn里面可以加filter,比如: "filter": {"match": {"my_label": "red"}} + + if search_type == "match_phrase": + body = { + "query": { + "bool": { + "should": [ + { + "match_phrase": { + "content": { + "query": unique_query, + "boost": weight, + "slop": search_type_attachment + } + } + } for unique_query, weight in unique_queries + ], + "minimum_should_match": 1 + } + } + } + # 纯关键词检索 2 + elif search_type == "match_keywords": + body = { + "query": { + "bool": { + "must": [ + { + "match": { + "content": {"query": core_term, "boost": 1.0} + } + } + ], + "should": [ + { + "match": { + "content": {"query": q, "boost": boost} + } + } for (q, boost) in [(keywords, 1.0), (expand, 0.6), (normalized_query, 1.0)] if q + ], + "minimum_should_match": 1 + } + } + } + # 关键词搜索+向量排序 + elif search_type == "match&boost": + body = { + "query": { + "function_score": { + "score_mode": "sum", + "boost_mode": "multiply", + "query": { + "match": { + "content": { + "query": keywords, + "boost": 1.0 + } + } + }, + "functions": [ + { + "script_score": { + "script": { + "source": "doc['embedding'].isEmpty() ? 1.0 : dotProduct(params.query_vector, 'embedding') + 1.0", + "params": {"query_vector": context.embeddings[0][1]} + } + } + } + ] + } + } + } + # 这个太慢 + elif search_type == "match&boost2": + body = { + "query": { + "script_score": { + "query": { + "match": { + "content": { + "query": keywords, + "boost": 1.0 + } + } + }, + "script": { + "source": "doc['embedding'].isEmpty() ? 1.0 : dotProduct(params.query_vector, 'embedding') + 1.0", + "params": {"query_vector": context.embeddings[0][1]} + } + } + } + } + # 向量搜索+关键词搜索 + elif search_type == "match&knn": + body = { + "query": { + "match": { + "content": { + "query": knn_boost_keywords, + "boost": 1.0 + } + } + }, + "knn": { + "field": "embedding", + "query_vector": context.embeddings[search_type_attachment][1], + "k": 5, + "num_candidates": 10, + "boost": 1.0 + } + } + # 纯向量搜索 + elif search_type == "knn": + body = { + "knn": { + "field": "embedding", + "query_vector": context.embeddings[search_type_attachment][1], + "k": 5, + "num_candidates": 10 + } + } + + need_embedding = (search_type == "match&boost") + need_highlights = (search_type != "knn") + + body["_source"] = {"excludes": ["keywords", "quotes"]} + if not need_embedding: + body["_source"]["excludes"].append("embedding") + # 在填充highlight之前写入search_from + search_from = f'searchtype[{search_type}],param[{search_type_attachment}],body:{body}' + + if need_highlights: + body["_source"]["excludes"] = [] + body["highlight"] = { + "pre_tags": [settings.HIGHTLIGHT_PRE_TAG], + "post_tags": [settings.HIGHTLIGHT_POST_TAG], + "fields": {"chapter_name": {}, "content": {}} + } + + body["size"] = size + + se_debug_info = '' + start_time = time.time() + try: + es_response = context.es.search(index=context.index_name, body=body) + except Exception as e: + se_debug_info = f'Error in executing search: {e}. request: {body}' + return None, se_debug_info + end_time = time.time() + elapsed_time = end_time - start_time + total_hits = es_response.get("hits", {}).get("total", {}).get("value", 0) + returned_hits = len(es_response.get("hits", {}).get("hits", [])) + + if not '"' in search_from: + search_from = search_from.replace('\'', '"') + search_from = search_from if len(search_from) < 400 else search_from[:400] + '...' + + str_body = str(body) + if not '"' in str_body: + str_body = str_body.replace('\'', '"') + se_debug_info = f'({elapsed_time:.2f} seconds. Total: {total_hits}. Returned: {returned_hits}) : {search_from[:400]}' + + if not 'hits' in es_response or not 'hits' in es_response['hits']: + se_debug_info += f' InvalidResponce in executing search: {e}. request: {body}' + return None, se_debug_info + + for hit in es_response['hits']['hits']: + hit['search_from'] = search_from + + return es_response, se_debug_info + +``` + + +# 测试向量: +# [-0.05291186273097992, 0.0274342093616724, -0.016730275005102158, 0.010487289167940617, -0.022640341892838478, -0.048682719469070435, 0.04544096067547798, 0.023079438135027885, 0.007221410982310772, 0.023566091433167458, 0.026696473360061646, 0.08252757787704468, -0.042835772037506104, 0.0009668126585893333, -0.02860398218035698, -0.004426108207553625, -0.002644421299919486, -0.027699561789631844, 0.005749804899096489, -0.04468372091650963, -0.0296687763184309, -0.009487600065767765, 0.020041221752762794, 0.00778265530243516, 0.008522099815309048, 0.03497027978301048, -0.021573258563876152, -0.028293319046497345, -8.54598984005861e-05, -0.03164539486169815, -0.017121458426117897, -0.0006902766763232648, 0.04650883004069328, -0.030234992504119873, -0.010207684710621834, -0.035288386046886444, -0.0047269039787352085, -0.0006454040994867682, -0.056146346032619476, 0.008901881985366344, 0.010757357813417912, -0.013022932223975658, 0.04627145081758499, -0.020669423043727875, -0.02031278982758522, -0.052186835557222366, -0.0148158585652709, -0.018267231062054634, -0.059003304690122604, -0.011793344281613827, 0.027096575126051903, 0.019299808889627457, 0.04161312058568001, -0.019393721595406532, -0.02361445501446724, 0.07711422443389893, -0.02068573422729969, -0.004702702630311251, -0.011135494336485863, 0.0101374052464962, -0.020808257162570953, 0.011924360878765583, -0.020093027502298355, -0.007138500455766916, 0.014727798290550709, 0.05770261213183403, 0.017841406166553497, 0.044339124113321304, -0.01490224339067936, -0.008343652822077274, -0.04842463508248329, 0.0336640290915966, -0.004893577191978693, -0.021536342799663544, -0.032384153455495834, -0.009452177211642265, -0.027460120618343353, -0.009426826611161232, 0.006357531528919935, 0.019494572654366493, 0.009722599759697914, -0.00497430982068181, 0.023032115772366524, 0.05221958085894585, -0.01671120524406433, 0.061740316450595856, -0.06789620220661163, -0.023851843550801277, -0.02249223366379738, -0.01231105625629425, -0.0499565526843071, 0.004251780919730663, 0.05466651916503906, -0.024449756368994713, -0.034151963889598846, 0.037387508898973465, -0.0016276679234579206, -0.02609393745660782, 0.01800747588276863, -0.0028136332985013723, -0.06036405637860298, 0.028903907164931297, 0.006318055558949709, 0.012870929203927517, -0.0021476889960467815, -0.012034566141664982, -0.008372323587536812, 0.024942906573414803, 0.08258169889450073, 0.006757829803973436, 0.032017264515161514, -0.012414710596203804, 0.014826267957687378, -0.040858786553144455, -0.0060302577912807465, 0.00843990221619606, -0.031066348776221275, -0.06313654035329819, 0.0056659989058971405, -0.007768781390041113, 0.011673268862068653, 0.007261875085532665, 0.006112886127084494, -0.07374890148639679, 0.06602894514799118, -0.05385972931981087, -0.0010994652984663844, 0.05939924344420433, 0.015503636561334133, 0.034621711820364, 0.008040975779294968, -0.023962488397955894, -0.06270411610603333, 0.00027893096557818353, -0.0436306893825531, -0.006309020332992077, 0.02416943572461605, -0.015391307882964611, -0.012442439794540405, -0.003181715961545706, -0.0021985983476042747, 0.008671553805470467, 0.004063367377966642, -0.02560708485543728, 0.03469422832131386, -0.04249674826860428, -0.013552767224609852, -0.052823010832071304, 0.014670411124825478, -0.011493593454360962, 0.024076055735349655, 0.056352417916059494, -0.008510314859449863, 0.015936613082885742, 0.003935575485229492, 0.0037949192337691784, 0.015074086375534534, 0.016583971679210663, -0.0057802870869636536, 0.005751866847276688, -0.009386995807290077, -0.03710195794701576, -0.03144300729036331, -0.07106415182352066, -0.003882911056280136, -0.010697683319449425, -0.014338435605168343, 0.007036983501166105, -0.035716522485017776, 0.06593189388513565, 0.007752529811114073, -0.030261363834142685, -0.02513342909514904, -0.039278656244277954, 0.015320679172873497, -0.012659071013331413, 0.014207725413143635, 0.010264124721288681, 0.01617652177810669, -0.022644126787781715, -0.031033707782626152, 0.04160666465759277, -0.05329348146915436, 0.02423500455915928, -0.019389694556593895, 0.008645910769701004, -0.005958682857453823, -0.03648180514574051, 0.011972597800195217, 0.037404924631118774, -0.007001751102507114, -0.05138246342539787, 0.0013400549069046974, -0.03268183395266533, 0.07687076926231384, -0.02033335529267788, -0.020667986944317818, 0.0038236891850829124, 0.029960744082927704, 0.015430699102580547, 0.05047214776277542, 0.0052254535257816315, 0.013995353132486343, -0.031164521351456642, -0.014291719533503056, 0.015829795971512794, -0.0013409113744273782, -0.044300951063632965, 0.045415859669446945, -0.005037966184318066, -0.03883415088057518, 0.027200160548090935, 0.008182630874216557, -0.046456750482320786, -0.029778052121400833, 0.02067168429493904, -0.006381513085216284, -0.04693000763654709, 0.009974686428904533, 0.03109011799097061, -0.012696364894509315, 0.030124813318252563, 0.02372679114341736, 0.06566771119832993, 0.03553507477045059, -0.032816141843795776, 0.028003521263599396, 0.06498659402132034, -0.013530750758945942, 0.0312667116522789, -0.015660811215639114, -0.00776742585003376, -0.004829467739909887, -0.015968922525644302, 0.04765664413571358, -0.0026502758264541626, 0.01891564577817917, 0.04119837284088135, 0.012158435769379139, 0.008338023908436298, -0.006039333995431662, 0.0630166307091713, -0.02758428454399109, 0.029347822070121765, -0.030129415914416313, 0.023165738210082054, 0.04064684361219406, 0.04446929693222046, -0.006133638322353363, -0.013095719739794731, -0.041152223944664, -0.01038535125553608, 0.01738007925450802, 0.0010595708154141903, -0.055003564804792404, 0.036829687654972076, -0.030270753428339958, -0.009607627056539059, 0.014103117398917675, 0.005140293389558792, 0.032931022346019745, 0.026972685009241104, -0.00039128100615926087, 0.00550195062533021, 0.062454141676425934, 0.02344602160155773, -0.01688288524746895, 0.011600837111473083, 0.009648085571825504, 0.012827200815081596, 0.02368510514497757, -0.044808436185121536, 0.006574536208063364, 0.03677171841263771, 0.021754244342446327, -0.0031720376573503017, -0.03498553857207298, -0.027119319885969162, 0.05196662247180939, 0.0063033513724803925, -0.002766692778095603, -0.03879206255078316, -0.005737128667533398, -0.02351462095975876, 0.04338989034295082, -0.03623301535844803, 0.003727369010448456, 0.044172726571559906, 0.06180792301893234, -0.025736358016729355, 0.01280374638736248, -0.01768171414732933, 0.0413120836019516, 0.036350950598716736, 0.020034022629261017, -0.00938474852591753, -0.04920303076505661, -0.1626604050397873, 0.0016566020203754306, -0.010797491297125816, 0.0037245014682412148, 0.039030417799949646, -0.009399985894560814, 0.016659803688526154, -0.047097429633140564, -0.00987484585493803, 0.020634479820728302, 0.005361238028854132, -0.05283225327730179, 0.002501025330275297, -0.004766151309013367, 0.00850654486566782, -0.0050267502665519714, -0.046555373817682266, 0.012670878320932388, 0.0018581973854452372, -0.010647253133356571, 0.01990092545747757, 0.02013244479894638, 0.04490885138511658, 0.029433563351631165, -0.01408607978373766, 0.029722925275564194, 0.04512600228190422, -0.04305345192551613, 0.0053901285864412785, -0.010685979388654232, 0.01516974437981844, 0.02340293675661087, -0.014181641861796379, -0.0013334851246327162, 0.020624764263629913, 0.06469231843948364, 0.016654038801789284, -0.043994754552841187, 0.025707466527819633, -0.004160136915743351, 0.021129926666617393, 0.041262850165367126, 0.006293899845331907, 0.056005991995334625, -0.006883381400257349, -0.07502268254756927, -0.02920101210474968, -0.019043054431676865, 0.00737513042986393, 0.013621360063552856, -0.02504715882241726, -0.01138006430119276, -0.010744514875113964, -0.02502342313528061, -0.03335903584957123, 0.012180354446172714, -0.03276645019650459, 0.05202409625053406, 0.03246080502867699, 0.03068908303976059, -0.029587913304567337, -0.04850265011191368, -0.006388102192431688, -0.03203853219747543, -0.050761956721544266, -0.021925227716565132, 0.036384399980306625, -0.011895880103111267, -0.007408954203128815, -0.012625153176486492, 0.0024322718381881714, -0.012196220457553864, -0.007011729292571545, -0.0337890200316906, -0.030034994706511497, 0.04638829082250595, -0.028362803161144257, -0.01176459901034832, 0.00956833828240633, -0.12054562568664551, -0.020540419965982437, 0.014624865725636482, -0.025515791028738022, -0.005027926992624998, -0.03586679324507713, -0.05585843697190285, -0.01700599677860737, -0.00044939795043319464, 0.029278729110956192, 0.25503888726234436, -0.024952411651611328, 0.005794796161353588, -0.007252118084579706, 0.03397773951292038, -0.0030146583449095488, -0.016645856201648712, -0.0008194005931727588, 0.02789629064500332, -0.039116114377975464, -0.035631854087114334, 0.04917449131608009, -0.006455820053815842, -0.011818122118711472, -0.00958359707146883, 0.013176187872886658, 0.037286531180143356, 0.022334400564432144, 0.05832865461707115, 0.010104321874678135, -0.04915979504585266, -0.022671189159154892, -0.016606582328677177, -0.007431587669998407, 0.0025214774068444967, -0.038979604840278625, 0.014895224012434483, 0.03583076596260071, 0.0006473385728895664, 0.04958082735538483, -0.017827684059739113, 0.015710417181253433, 0.062094446271657944, -0.014381879940629005, 0.0002880772517528385, 0.004948006477206945, -8.711735063116066e-06, -0.0029445397667586803, -0.044325683265924454, 0.047702621668577194, -0.03197811171412468, -0.02109563909471035, 0.03041824884712696, 0.021582895889878273, -0.004118872340768576, -0.025784745812416077, 0.06275995075702667, 0.006879465654492378, 0.04185185581445694, 0.02031264826655388, -0.02274201810359955, -0.009617358446121216, -0.04315454140305519, -0.033287111669778824, -0.025126483291387558, -0.003923895303159952, -0.041508499532938004, -0.0009355457150377333, -0.033565372228622437, 0.02229289337992668, -0.0026574484072625637, -0.0028596664778888226, -0.02223617024719715, -0.016868866980075836, 0.04172029718756676, 0.0014162511797621846, -0.037737537175416946, -0.010155809111893177, -0.010357595980167389, 0.04541466012597084, 0.03563382104039192, -0.019189776852726936, -0.012577632442116737, -0.013781189918518066, 0.026566311717033386, 0.020911909639835358, 0.02781282551586628, 0.053938526660203934, 0.0194545891135931, 0.0015139722963795066, -0.0357731431722641, -0.005088387057185173, 0.004257760010659695, 0.04332628846168518, -0.012149352580308914, -0.04734082147479057, 0.018029984086751938, -0.01322091929614544, -0.059820450842380524, -0.03677783161401749, -0.006745075341314077, -0.02209635078907013, -0.012663901783525944, -0.0059855030849576, 0.016270749270915985, -0.00725028058513999, 0.03019685670733452, 0.010252268984913826, -0.06314245611429214, -0.005512078758329153, -0.016377074643969536, -0.0014438428916037083, 0.029021194204688072, -0.015355946496129036, 0.02559172362089157, -0.04241044819355011, 0.010147088207304478, -0.016036594286561012, 0.023162752389907837, 0.047236304730176926, 0.0166736152023077, 0.01226564310491085, -0.015224735252559185, -0.01298521552234888, -0.008012642152607441, 0.028470756486058235, -0.013741613365709782, 0.019896863028407097, 0.01720179058611393, 0.01571199856698513, 0.030143165960907936, -0.02969514951109886, 0.014739652164280415, -0.01854291744530201, -0.045576371252536774, -0.04516203701496124, 0.02147211693227291, 0.007073952350765467, 0.008106761611998081, -0.01828523352742195, 0.002731812885031104, -0.04545339569449425, 0.019007619470357895, 0.03504781052470207, 0.037705861032009125, -0.0045634908601641655, 0.0070000626146793365, 0.0037205498665571213, 0.005224148277193308, -0.017060590907931328, -0.04246727377176285, -0.006265614647418261, -0.015374364331364632, -0.03380871191620827, -0.005029333755373955, 0.007065227720886469, 0.003886009333655238, 0.008613690733909607, -0.012133199721574783, 0.005556005053222179, -0.021959641948342323, 0.04834386706352234, 0.03787781298160553, -0.057815466076135635, 0.015909207984805107, -0.03855409845709801, 0.0018244135426357388, 0.04186264052987099, -0.054983459413051605, 0.006219237111508846, 0.03494301065802574, 0.023722950369119644, 0.0312604121863842, 0.05597991123795509, -0.030345493927598, 0.016615940257906914, -0.0207205917686224, 0.055960651487112045, -0.012713379226624966, -0.0261109359562397, 0.014332456514239311, -0.017245708033442497, -0.06636268645524979, 0.00592504907399416, 0.04649018123745918, -0.018362276256084442, 0.009620632976293564, -0.0044480785727500916, -0.0014729035319760442, 0.015621249563992023, 0.0367378331720829, -0.011857259087264538, -0.045088741928339005, 0.0006832792423665524, 0.02601524256169796, -0.02120809443295002, 0.018104318529367447, 0.008069046773016453, 0.013658273033797741, 0.004183551296591759, -0.04133244603872299, 0.05436890944838524, 0.009334285743534565, -0.014695074409246445, -0.011054124683141708, 0.009796642698347569, -0.008759389631450176, -0.06399217247962952, -0.0028859861195087433, -0.008736967109143734, -0.003506746841594577, 0.008123806677758694, 0.008794951252639294, -0.02940259501338005, 0.009597218595445156, -0.02197900228202343, -0.02082076109945774, 0.023915970697999, -0.059058744460344315, -0.010253551416099072, 0.024443935602903366, -0.029604850336909294, 0.008135135285556316, 0.03568771481513977, -0.017330091446638107, -0.003135789418593049, 0.035103678703308105, 0.0370408296585083, -0.01022601593285799, -0.045891791582107544, 0.01726667769253254, -0.008570673875510693, 0.015297998674213886, -0.015412220731377602, -0.01425748411566019, 0.031544867902994156, 0.013110813684761524, -0.057211123406887054, -0.0008968000765889883, 0.001981658162549138, -0.002101168967783451, -0.09516698867082596, -0.034693196415901184, 0.011157260276377201, 0.010063023306429386, -0.02550840750336647, 0.009959851391613483, 0.022281678393483162, -0.03908146917819977, 0.02196437120437622, 0.03520793840289116, -0.06856158375740051, -0.004901218693703413, 0.1122148334980011, -0.01498009730130434, 0.03165500983595848, -0.07618033140897751, -0.014297851361334324, 0.02150021120905876, 0.005999598652124405, -0.013493427075445652, 0.013868110254406929, 0.00079053093213588, 0.006475066766142845, 0.000955471652559936, -0.03403160721063614, -0.02295752801001072, 0.0041635241359472275, -0.03955964744091034, -0.04943346977233887, 0.00032474088948220015, 0.039174411445856094, -0.011974001303315163, 0.008057610131800175, 0.03809700161218643, -0.041719768196344376, 0.037615906447172165, -0.035932306200265884, 0.008293192833662033, -0.03261689469218254, -0.023902395740151405, -7.811257091816515e-05, -0.011328466236591339, -0.026476409286260605, 0.055370282381772995, 0.03128054738044739, -0.014991461299359798, 0.017835773527622223, 0.01642710715532303, 0.029273470863699913, -0.012139911763370037, 0.01371818222105503, -0.013113478198647499, -0.04071088507771492, 0.0233455840498209, -0.019497444853186607, -0.01747158169746399, 0.02493683062493801, 0.024074571207165718, -0.03614620864391327, -0.025289475917816162, -0.04030011221766472, -0.046772539615631104, 0.009969661012291908, 0.003724620910361409, 0.007474626414477825, -0.04855594411492348, 0.04697829484939575, 0.010695616714656353, 0.027944304049015045, -0.003937696572393179, -0.011591222137212753, -0.011533009819686413, 0.03215765953063965, -0.04699324443936348, -9.356102236779407e-05, -0.01535400003194809, -0.010238519869744778, 0.002703386126086116, 0.04759520664811134, 0.0074842446483671665, -0.04050430282950401, -0.028402622789144516, -0.03205197677016258, 0.011288953013718128, 0.006053865421563387, 0.04641448333859444, 0.005652922671288252, -0.018560705706477165, 0.02581481821835041, 0.00962467584758997, -0.017888177186250687, -0.026476262137293816, -0.005547264125198126, 0.012222226709127426, -0.004069746006280184, -0.020438821986317635, 0.01929863728582859, -0.0053736320696771145, 0.02221786603331566, -0.007175051141530275, 0.003961225971579552, -0.012380941770970821, -0.0040277824737131596, 0.009086307138204575, 0.012202796526253223, 0.018483169376850128, 0.017530532553792, 0.0422886498272419, 0.04987001419067383, 0.003722204128280282, 0.06421508640050888, -0.016258088871836662, -0.027659112587571144, 0.004458434879779816, -0.02898143045604229, -0.014475414529442787, 0.032039571553468704, -0.025734663009643555, -0.01585981249809265, 0.04900333285331726, -0.06422552466392517, -0.0007134959450922906, -0.04035528376698494, 0.03290264680981636, -0.0018848407780751586, 0.0068516512401402, 0.00032433189335279167, -0.002669606124982238, -0.017596688121557236, -0.026878179982304573, 0.014075388200581074, 0.020072080194950104, -0.00295435544103384, -0.01918656937777996, -0.007689833641052246, 0.039347097277641296, 0.0026605715975165367, 0.011779646389186382, 0.04189120978116989, -0.03846775367856026, -0.01993645168840885, 0.04546443000435829, 0.05682912468910217, -0.012384516187012196, -0.004507445730268955, 0.007476931903511286, -0.01160018052905798, 0.006559243891388178, 0.04354899004101753, 0.006185194011777639, 0.028355205431580544, -0.006518798414617777, -0.029528537765145302, 0.06740271300077438, -0.052158474922180176, 0.0025031850673258305, -0.005957300774753094, 0.00500349560752511, 0.022637680172920227, -0.0027129461523145437, -0.011677206493914127, -0.042732879519462585, -0.0021236639004200697, -0.1499215066432953, 0.02914350852370262, -0.031246500089764595, -0.027244996279478073, -0.006904688663780689, 0.01088196225464344, 0.01271661464124918, -0.0430884025990963, -0.020760131999850273, -0.006593034137040377, -0.0007962957606650889, -0.031729113310575485, 0.052976224571466446, -0.03149586543440819, 0.0392388291656971, 0.023318620398640633, -0.01383691094815731, 0.02858218550682068, 0.023135144263505936, 0.026421336457133293, 0.00027594034327194095, -0.03901490569114685, 0.008533132262527943, -0.03802476078271866, -0.011105065234005451, -0.028275510296225548, 0.04846742004156113, 0.021237077191472054, -0.027375172823667526, -0.02717825025320053, -0.031243441626429558, -0.021638689562678337, 0.024066096171736717, 0.05689090117812157, -0.04352620989084244, 0.03599394112825394, 0.05153508856892586, 0.002263782313093543, 0.047110624611377716, 0.006084555760025978, 0.003244618885219097, -0.0015037712873890996, 0.027960799634456635, -0.013650861568748951, 0.03281615301966667, 0.012363187968730927, 0.02162906341254711, -0.010951842181384563, -0.02786285988986492, 0.03754381462931633, 0.01957041770219803, -0.017010418698191643, -0.008339766412973404, 0.0755641758441925, 0.023412147536873817, -0.005748848430812359, -0.05465301498770714, -0.02190011739730835, 0.0054182386957108974, 0.032733004540205, -0.05342638120055199, 0.009907999075949192, -0.02370712347328663, -0.015652501955628395, -0.011254304088652134, -0.019827252253890038, -0.021032121032476425, -0.02607329562306404, -0.0008710312540642917, -0.06800976395606995, -0.017296750098466873, 0.015312970615923405, -0.015649013221263885, -0.016449443995952606, -0.012058117426931858, 0.002104945247992873, 0.020476385951042175, 0.014795565977692604, -0.02145536057651043, -0.028734024614095688, -0.041212357580661774, -0.008211270906031132, 0.033569078892469406, -0.0033273063600063324, -0.02339683100581169, 0.0421740785241127, -0.009677124209702015, -0.006869456730782986, -0.016001028940081596, 0.029614608734846115, -0.06062136963009834, -0.011824233457446098, 0.012096629478037357, -0.028248939663171768, -0.03703905642032623, 0.012119539082050323, -0.041021380573511124, 0.01975782960653305, -0.028443211689591408, 0.020459437742829323, 0.0073023103177547455, -0.06498327851295471, -0.004016770515590906, 0.06460512429475784, -0.053343966603279114, 0.03865537419915199, -5.4113028454594314e-05, -0.008642046712338924, -0.009384138509631157, -0.037736788392066956, -0.035090748220682144, 0.018596891313791275, -0.008763385005295277, 0.040228284895420074, 0.03811536356806755, -0.034618355333805084, -0.004665717948228121, 0.04813361540436745, -0.004303373862057924, 0.00795511994510889, -0.017838604748249054, 0.00563138909637928, -0.03171280398964882, -0.0259436946362257, 0.004301885142922401, -0.02739236131310463, 0.03270035237073898, 0.009064823389053345, -0.0363747663795948, 0.02325567975640297, 0.03453107923269272, -0.012906554155051708, 0.028347544372081757, 0.01234712265431881, 0.030589573085308075, 0.0024874424561858177, -0.0173872709274292, 0.0247347354888916, 0.004171399865299463, 0.02350561134517193, -0.05499064922332764, -0.023146219551563263, -0.012485259212553501, -0.0228674728423357, 0.013267520815134048, 0.021304689347743988, -0.018937893211841583, -0.0260267723351717, -0.022532619535923004, 0.0030378480441868305, -0.008528024889528751, -0.030528495088219643, -0.009305189363658428, -0.0074027362279593945, -0.020641637966036797, 0.006984233390539885, 0.04300186410546303, -0.033014994114637375, -0.006089311558753252, 0.04753036051988602, -0.036625705659389496, -0.04691743850708008, -0.007467558141797781, 0.0652017593383789, -0.03861508145928383, -0.00741452956572175, 0.003471594536677003, 0.016132064163684845, 0.01570185460150242, 0.018733495846390724, -0.019025148823857307, 0.003490244736894965, -0.017714614048600197, -0.003447450464591384, 0.015267218463122845, 0.015076974406838417, -0.002631498035043478, 0.005311752203851938, 0.014075293205678463, 0.0026123111601918936, 0.011874910444021225, 0.0714355856180191, 0.06941138952970505, 0.022251378744840622, 0.01972009800374508, 0.04719123989343643, 0.023544959723949432, 0.017852554097771645, 0.01843070052564144, -0.05294886603951454, -0.008682304993271828, 0.010625398717820644, 0.0428495928645134, 0.002173527143895626, 0.06291069090366364, 0.024296458810567856, 0.008714474737644196, 0.06520587205886841, 0.015627536922693253, 0.04247526824474335, 0.0009774811333045363, 0.00738496845588088, -0.024803027510643005, 0.013228596188127995, -0.037615202367305756, -0.028807995840907097, 0.012890785001218319, -0.01587829552590847, -0.01928863860666752, 0.0011809614952653646, -0.026926854625344276, -0.020252779126167297, -0.010968486778438091, -0.015348547138273716, 0.008559435606002808, -0.009286923334002495, 0.0014621232403442264, 0.03831499442458153, 0.016517579555511475, 0.037184324115514755, -0.041231196373701096, 0.03757374733686447, -0.039465345442295074, -0.04308579862117767, 0.0011091071646660566, -0.029794104397296906, 0.008459310978651047, -0.01713281124830246, -0.016625113785266876, -0.05582521855831146, -0.0415986105799675, 0.028725938871502876, 0.04966316372156143, 0.012718678452074528, -0.025533588603138924, 0.013822318986058235, -5.168768620933406e-05, 0.02616700902581215, -0.06113629788160324, -0.03175340220332146, 0.03593592345714569, -0.04014921560883522, -0.020605407655239105, 0.02186705358326435] +``` \ No newline at end of file diff --git a/docs/ES/ES_8.18/2_kibana安装.md b/docs/ES/ES_8.18/2_kibana安装.md new file mode 100644 index 0000000..e9c7a31 --- /dev/null +++ b/docs/ES/ES_8.18/2_kibana安装.md @@ -0,0 +1,51 @@ + + + + + +## 1. yum安装 +添加yum仓库。 +Kibana通常不是yum默认仓库的一部分,因此需要添加 Elastic 仓库:: +```shell + +导入 Elastic 签名密钥: +sudo rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch + +添加 Elastic 仓库: +sudo tee /etc/yum.repos.d/elastic.repo < 无效的源发行版: 18 +原因是我们指定的源发行版不匹配Java编译器的版本。 +1. 确保这里配置对了 +sourceCompatibility = JavaVersion.VERSION_18 // 不同版本的es,需要不同版本的java环境,注意修改这里 +targetCompatibility = JavaVersion.VERSION_18 // 不同版本的es,需要不同版本的java环境,注意修改这里 +2. elasticsearch --version 提示ES的java版本是21,因此将以上配置改为21。 为了简化问题,决定回退ES版本,改回8.4.1,这样插件的配置文件都不用改了,直接用8.4.1分支就行。 +3. java版本是1.8,不是18(之前以为1.8就是18,卡在这里大半天)。重新安装jdk18就好了。 +javac -version +javac 1.8.0_362 +# 注意yum里面只到17,没有18,下载jdk18,以rpm方式安装:https://www.oracle.com/java/technologies/javase/jdk18-archive-downloads.html +# 注意如果之前自己手动配置了JAVA_HOME,要把他删掉。 +yum remove java-1.8.0-* (之前yum remove java*,有可能有问题) +rpm -ivh jdk-18.0.2.1_linux-x64_bin.rpm +现在三个的版本就都对了: +javac -version +javac 18.0.2.1 + +[root@192 ~]# elasticsearch --version +warning: ignoring JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk; using bundled JDK +Version: 8.4.1, Build: rpm/2bd229c8e56650b42e40992322a76e7914258f0c/2022-08-26T12:11:43.232597118Z, JVM: 18.0.2 + +gradle --version (gradle用的jdk是1.8 不用管,插件的readme上注明gradle版本7.6匹配ES版本8.4.1) +Gradle 7.6.4 +JVM: 1.8.0_362 + + + diff --git a/docs/ES/ES_8.18/3.3_ik分词器.md b/docs/ES/ES_8.18/3.3_ik分词器.md new file mode 100644 index 0000000..a353f6d --- /dev/null +++ b/docs/ES/ES_8.18/3.3_ik分词器.md @@ -0,0 +1,9 @@ + + + + +cd /usr/share/elasticsearch/plugins/ +wget https://release.infinilabs.com/analysis-ik/stable/elasticsearch-analysis-ik-8.18.0.zip +unzip elasticsearch-analysis-ik-8.18.0.zip -d elasticsearch-analysis-ik-8.18.0 +systemctl restart elasticsearch + diff --git a/docs/ES/ES_8.18/3_ansj分词插件安装.md b/docs/ES/ES_8.18/3_ansj分词插件安装.md new file mode 100644 index 0000000..8fd8bef --- /dev/null +++ b/docs/ES/ES_8.18/3_ansj分词插件安装.md @@ -0,0 +1,97 @@ + +https://github.com/NLPchina/elasticsearch-analysis-ansj + + +git clone https://github.com/NLPchina/elasticsearch-analysis-ansj.git +cd elasticsearch-analysis-ansj +git checkout v8.3.3 +mvn package + +会提示编译失败(v8.x版本都会失败,7.x就没问题),错误信息如下: +[ERROR] /ssd/samba_root1/projects/ansj/elasticsearch-analysis-ansj/src/main/java/org/ansj/elasticsearch/plugin/AnalysisAnsjPlugin.java:[14,34] 无法访问org.apache.lucene.analysis.Analyzer +[ERROR] 错误的类文件: /home/hello/.m2/repository/org/apache/lucene/lucene-core/9.2.0/lucene-core-9.2.0.jar(org/apache/lucene/analysis/Analyzer.class) +[ERROR] 类文件具有错误的版本 55.0, 应为 52.0 +[ERROR] 请删除该文件或确保该文件位于正确的类路径子目录中。 + +7.x版本都没问题,8.x就会出这个错误。尝试把jdk版本从1.8改成 11, 17, 18、升级maven版本到3.9.6都不行(又提示类文件具有错误的版本 61.0, 应为 55.0)。 +有人说可能是依赖冲突,不知道是否可以修改下环境,使得不冲突。 + +因此自己编译只能编译v7.17.16。8.x,release里面有现成的版本: +./bin/elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-analysis-ansj/releases/download/v8.7.0/elasticsearch-analysis-ansj-8.7.0.0-release.zip + +测试: +kibana中 : GET /_cat/ansj?text=中国&type=index_ansj +或者: +curl -X GET "http://localhost:9200/_cat/ansj?text=中国&type=index_ansj" + + +curl -X GET "http://localhost:9200/_cat/ansj?pretty" -H 'Content-Type: application/json' -d' +{ + "type": "index_ansj", + "text": "中国" +}' + +# 注意事项 +ansj分词如果没有设置停用词的话,空格也会被分出来,搜出来的结果空格也会被飘红(如果query带空格的话)。所以一定要设置停用词表。 + +词性说明: + 附-词性表格 + 符号 词性 解释 + n 名词 取英语名词noun的第1个字母。 + np 人名 + nr 人名 名词代码n和“人(ren)”的声母并在一起。 + nh 人名 + ns 地名 名词代码n和处所词代码s并在一起 + ni 机构名 + nz 其它专名 + nt 机构团体名 “团”的声母为t,名词代码n和t并在一起。 + nl 名词性惯用语 + nd 方位名词 + ng 名词性语素 + b 区别词 + m 数词 取英语numeral的第3个字母,n,u已有他用。 + q 量词 取英语quantity的第1个字母。 + mq 数量词 + t 时间词 取英语time的第1个字母。 + f 方位词 取汉字“方” 的声母。 + s 处所词 取英语space的第1个字母 + v 动词 取英语动词verb的第一个字母。 + vd 副动词 + vn 名动词 + vshi 动词“是” + vyou 动词“有” + vf 趋向动词 + vx 形式动词 + vi 不及物动词(内动词) + vl 动词性惯用语 + vg 动词性语素 + a 形容词 取英语形容词adjective的第1个字母。 + an 名形词 + ad 副形词 + an 名形词 + ag 形容词性语素 + al 形容词性惯用语 + d 副词 取adverb的第2个字母,因其第1个字母已用于形容词。 + h 前接成分 取英语head的第1个字母。 + k 后接成分 + i 成语 取英语成语idiom的第1个字母。 + j 简称 取汉字“简”的声母。 + l 习用语 习用语尚未成为成语,有点“临时性”,取“临”的声母 + r 代词 取英语代词pronoun的第2个字母,因p已用于介词。 + c 连词 取英语连词conjunction的第1个字母。 + p 介词 取英语介词prepositional的第1个字母。 + u 助词 取英语助词auxiliary 的第2个字母,因a已用于形容词。 + ud 结构助词 有 + ug 时态助词 你 + uj 结构助词的 迈向 + ul 时态助词了 完成 + uv 结构助词地 满怀信心 + uz 时态助词着 眼看 + y 语气助词 取汉字“语”的声母。 + e 叹词 取英语叹词exclamation的第1个字母。 + o 拟声词 取英语拟声词onomatopoeia的第1个字母。 + g 语素 绝大多数语素都能作为合成词的“词根”,取汉字“根”的声母。 + w 标点 + x 其它 非语素字只是一个符号,字母x通常用于代表未知数、符号。 + z 状态词 取汉字“状”的声母的前一个字母。 + tg 时语素 时间词性语素。时间词代码为t,在语素的代码g前面置以T。 \ No newline at end of file diff --git a/docs/ES/ES_8.18/4_索引和查询测试.md b/docs/ES/ES_8.18/4_索引和查询测试.md new file mode 100644 index 0000000..93b5136 --- /dev/null +++ b/docs/ES/ES_8.18/4_索引和查询测试.md @@ -0,0 +1,74 @@ +# 查询官方文档: +https://link.zhihu.com/?target=https%3A//www.elastic.co/guide/cn/elasticsearch/guide/current/query-dsl-intro.html + + +# 查看配置 +curl "localhost:9200/_nodes/settings?pretty=true" + + +# 测试多字段搜索(支持中文分词): +curl -X GET "localhost:9200/goods/_search" -H 'Content-Type: application/json' -d' +{ + "query": { + "multi_match": { + "query": "玩具", + "fields": ["name^2", "name_zh^2", "sub_name_zh^2", "brand_name_zh^2", "category_name_zh^2"], + "fuzziness": "AUTO" + } + }, + "highlight": { + "fields": { + "name": {}, + "name_zh": {}, + "sub_name_zh": {}, + "brand_name_zh": {}, + "category_name_zh": {} + } + }, + "from": 0, + "size": 10 +}' + +# 测试精确匹配: +curl -X GET "localhost:9200/goods/_search" -H "Content-Type: application/json" -d' +{ + "query": { + "term": { + "goods_id": "2683337" + } + } +}' + + +# 查看索引分词情况: +curl -X GET "http://localhost:9200/goods/_doc/1?pretty" +curl -X GET "http://localhost:9200/goods/_termvectors/1?fields=*&pretty" + +# 如果文档不存在,找出任意一个文档,得到ID: +curl -X GET "http://localhost:9200/goods/_search?size=1&pretty" +# 得到ID后查询termvectors: +curl -X GET "http://localhost:9200/goods/_termvectors/[DOC_ID]?fields=*&pretty" + + +# 测试analyzer: +curl -X GET "http://localhost:9200/goods/_analyze?pretty" -H 'Content-Type: application/json' -d' +{ + "text": "玩具", + "analyzer": "index_ansj" +}' + + + +# 测试向量搜索: +curl -X GET "localhost:9200/goods/_search" -H "Content-Type: application/json" -d' +{ + "query": { + "script_score": { + "query": {"match_all": {}}, + "script": { + "source": "cosineSimilarity(params.query_vector, 'name_prefix') + 1.0", + "params": {"query_vector": [-0.05291186273097992, 0.0274342093616724, -0.016730275005102158, 0.010487289167940617, -0.022640341892838478, -0.048682719469070435, 0.04544096067547798, 0.023079438135027885, 0.007221410982310772, 0.023566091433167458, 0.026696473360061646, 0.08252757787704468, -0.042835772037506104, 0.0009668126585893333, -0.02860398218035698, -0.004426108207553625, -0.002644421299919486, -0.027699561789631844, 0.005749804899096489, -0.04468372091650963, -0.0296687763184309, -0.009487600065767765, 0.020041221752762794, 0.00778265530243516, 0.008522099815309048, 0.03497027978301048, -0.021573258563876152, -0.028293319046497345, -8.54598984005861e-05, -0.03164539486169815, -0.017121458426117897, -0.0006902766763232648, 0.04650883004069328, -0.030234992504119873, -0.010207684710621834, -0.035288386046886444, -0.0047269039787352085, -0.0006454040994867682, -0.056146346032619476, 0.008901881985366344, 0.010757357813417912, -0.013022932223975658, 0.04627145081758499, -0.020669423043727875, -0.02031278982758522, -0.052186835557222366, -0.0148158585652709, -0.018267231062054634, -0.059003304690122604, -0.011793344281613827, 0.027096575126051903, 0.019299808889627457, 0.04161312058568001, -0.019393721595406532, -0.02361445501446724, 0.07711422443389893, -0.02068573422729969, -0.004702702630311251, -0.011135494336485863, 0.0101374052464962, -0.020808257162570953, 0.011924360878765583, -0.020093027502298355, -0.007138500455766916, 0.014727798290550709, 0.05770261213183403, 0.017841406166553497, 0.044339124113321304, -0.01490224339067936, -0.008343652822077274, -0.04842463508248329, 0.0336640290915966, -0.004893577191978693, -0.021536342799663544, -0.032384153455495834, -0.009452177211642265, -0.027460120618343353, -0.009426826611161232, 0.006357531528919935, 0.019494572654366493, 0.009722599759697914, -0.00497430982068181, 0.023032115772366524, 0.05221958085894585, -0.01671120524406433, 0.061740316450595856, -0.06789620220661163, -0.023851843550801277, -0.02249223366379738, -0.01231105625629425, -0.0499565526843071, 0.004251780919730663, 0.05466651916503906, -0.024449756368994713, -0.034151963889598846, 0.037387508898973465, -0.0016276679234579206, -0.02609393745660782, 0.01800747588276863, -0.0028136332985013723, -0.06036405637860298, 0.028903907164931297, 0.006318055558949709, 0.012870929203927517, -0.0021476889960467815, -0.012034566141664982, -0.008372323587536812, 0.024942906573414803, 0.08258169889450073, 0.006757829803973436, 0.032017264515161514, -0.012414710596203804, 0.014826267957687378, -0.040858786553144455, -0.0060302577912807465, 0.00843990221619606, -0.031066348776221275, -0.06313654035329819, 0.0056659989058971405, -0.007768781390041113, 0.011673268862068653, 0.007261875085532665, 0.006112886127084494, -0.07374890148639679, 0.06602894514799118, -0.05385972931981087, -0.0010994652984663844, 0.05939924344420433, 0.015503636561334133, 0.034621711820364, 0.008040975779294968, -0.023962488397955894, -0.06270411610603333, 0.00027893096557818353, -0.0436306893825531, -0.006309020332992077, 0.02416943572461605, -0.015391307882964611, -0.012442439794540405, -0.003181715961545706, -0.0021985983476042747, 0.008671553805470467, 0.004063367377966642, -0.02560708485543728, 0.03469422832131386, -0.04249674826860428, -0.013552767224609852, -0.052823010832071304, 0.014670411124825478, -0.011493593454360962, 0.024076055735349655, 0.056352417916059494, -0.008510314859449863, 0.015936613082885742, 0.003935575485229492, 0.0037949192337691784, 0.015074086375534534, 0.016583971679210663, -0.0057802870869636536, 0.005751866847276688, -0.009386995807290077, -0.03710195794701576, -0.03144300729036331, -0.07106415182352066, -0.003882911056280136, -0.010697683319449425, -0.014338435605168343, 0.007036983501166105, -0.035716522485017776, 0.06593189388513565, 0.007752529811114073, -0.030261363834142685, -0.02513342909514904, -0.039278656244277954, 0.015320679172873497, -0.012659071013331413, 0.014207725413143635, 0.010264124721288681, 0.01617652177810669, -0.022644126787781715, -0.031033707782626152, 0.04160666465759277, -0.05329348146915436, 0.02423500455915928, -0.019389694556593895, 0.008645910769701004, -0.005958682857453823, -0.03648180514574051, 0.011972597800195217, 0.037404924631118774, -0.007001751102507114, -0.05138246342539787, 0.0013400549069046974, -0.03268183395266533, 0.07687076926231384, -0.02033335529267788, -0.020667986944317818, 0.0038236891850829124, 0.029960744082927704, 0.015430699102580547, 0.05047214776277542, 0.0052254535257816315, 0.013995353132486343, -0.031164521351456642, -0.014291719533503056, 0.015829795971512794, -0.0013409113744273782, -0.044300951063632965, 0.045415859669446945, -0.005037966184318066, -0.03883415088057518, 0.027200160548090935, 0.008182630874216557, -0.046456750482320786, -0.029778052121400833, 0.02067168429493904, -0.006381513085216284, -0.04693000763654709, 0.009974686428904533, 0.03109011799097061, -0.012696364894509315, 0.030124813318252563, 0.02372679114341736, 0.06566771119832993, 0.03553507477045059, -0.032816141843795776, 0.028003521263599396, 0.06498659402132034, -0.013530750758945942, 0.0312667116522789, -0.015660811215639114, -0.00776742585003376, -0.004829467739909887, -0.015968922525644302, 0.04765664413571358, -0.0026502758264541626, 0.01891564577817917, 0.04119837284088135, 0.012158435769379139, 0.008338023908436298, -0.006039333995431662, 0.0630166307091713, -0.02758428454399109, 0.029347822070121765, -0.030129415914416313, 0.023165738210082054, 0.04064684361219406, 0.04446929693222046, -0.006133638322353363, -0.013095719739794731, -0.041152223944664, -0.01038535125553608, 0.01738007925450802, 0.0010595708154141903, -0.055003564804792404, 0.036829687654972076, -0.030270753428339958, -0.009607627056539059, 0.014103117398917675, 0.005140293389558792, 0.032931022346019745, 0.026972685009241104, -0.00039128100615926087, 0.00550195062533021, 0.062454141676425934, 0.02344602160155773, -0.01688288524746895, 0.011600837111473083, 0.009648085571825504, 0.012827200815081596, 0.02368510514497757, -0.044808436185121536, 0.006574536208063364, 0.03677171841263771, 0.021754244342446327, -0.0031720376573503017, -0.03498553857207298, -0.027119319885969162, 0.05196662247180939, 0.0063033513724803925, -0.002766692778095603, -0.03879206255078316, -0.005737128667533398, -0.02351462095975876, 0.04338989034295082, -0.03623301535844803, 0.003727369010448456, 0.044172726571559906, 0.06180792301893234, -0.025736358016729355, 0.01280374638736248, -0.01768171414732933, 0.0413120836019516, 0.036350950598716736, 0.020034022629261017, -0.00938474852591753, -0.04920303076505661, -0.1626604050397873, 0.0016566020203754306, -0.010797491297125816, 0.0037245014682412148, 0.039030417799949646, -0.009399985894560814, 0.016659803688526154, -0.047097429633140564, -0.00987484585493803, 0.020634479820728302, 0.005361238028854132, -0.05283225327730179, 0.002501025330275297, -0.004766151309013367, 0.00850654486566782, -0.0050267502665519714, -0.046555373817682266, 0.012670878320932388, 0.0018581973854452372, -0.010647253133356571, 0.01990092545747757, 0.02013244479894638, 0.04490885138511658, 0.029433563351631165, -0.01408607978373766, 0.029722925275564194, 0.04512600228190422, -0.04305345192551613, 0.0053901285864412785, -0.010685979388654232, 0.01516974437981844, 0.02340293675661087, -0.014181641861796379, -0.0013334851246327162, 0.020624764263629913, 0.06469231843948364, 0.016654038801789284, -0.043994754552841187, 0.025707466527819633, -0.004160136915743351, 0.021129926666617393, 0.041262850165367126, 0.006293899845331907, 0.056005991995334625, -0.006883381400257349, -0.07502268254756927, -0.02920101210474968, -0.019043054431676865, 0.00737513042986393, 0.013621360063552856, -0.02504715882241726, -0.01138006430119276, -0.010744514875113964, -0.02502342313528061, -0.03335903584957123, 0.012180354446172714, -0.03276645019650459, 0.05202409625053406, 0.03246080502867699, 0.03068908303976059, -0.029587913304567337, -0.04850265011191368, -0.006388102192431688, -0.03203853219747543, -0.050761956721544266, -0.021925227716565132, 0.036384399980306625, -0.011895880103111267, -0.007408954203128815, -0.012625153176486492, 0.0024322718381881714, -0.012196220457553864, -0.007011729292571545, -0.0337890200316906, -0.030034994706511497, 0.04638829082250595, -0.028362803161144257, -0.01176459901034832, 0.00956833828240633, -0.12054562568664551, -0.020540419965982437, 0.014624865725636482, -0.025515791028738022, -0.005027926992624998, -0.03586679324507713, -0.05585843697190285, -0.01700599677860737, -0.00044939795043319464, 0.029278729110956192, 0.25503888726234436, -0.024952411651611328, 0.005794796161353588, -0.007252118084579706, 0.03397773951292038, -0.0030146583449095488, -0.016645856201648712, -0.0008194005931727588, 0.02789629064500332, -0.039116114377975464, -0.035631854087114334, 0.04917449131608009, -0.006455820053815842, -0.011818122118711472, -0.00958359707146883, 0.013176187872886658, 0.037286531180143356, 0.022334400564432144, 0.05832865461707115, 0.010104321874678135, -0.04915979504585266, -0.022671189159154892, -0.016606582328677177, -0.007431587669998407, 0.0025214774068444967, -0.038979604840278625, 0.014895224012434483, 0.03583076596260071, 0.0006473385728895664, 0.04958082735538483, -0.017827684059739113, 0.015710417181253433, 0.062094446271657944, -0.014381879940629005, 0.0002880772517528385, 0.004948006477206945, -8.711735063116066e-06, -0.0029445397667586803, -0.044325683265924454, 0.047702621668577194, -0.03197811171412468, -0.02109563909471035, 0.03041824884712696, 0.021582895889878273, -0.004118872340768576, -0.025784745812416077, 0.06275995075702667, 0.006879465654492378, 0.04185185581445694, 0.02031264826655388, -0.02274201810359955, -0.009617358446121216, -0.04315454140305519, -0.033287111669778824, -0.025126483291387558, -0.003923895303159952, -0.041508499532938004, -0.0009355457150377333, -0.033565372228622437, 0.02229289337992668, -0.0026574484072625637, -0.0028596664778888226, -0.02223617024719715, -0.016868866980075836, 0.04172029718756676, 0.0014162511797621846, -0.037737537175416946, -0.010155809111893177, -0.010357595980167389, 0.04541466012597084, 0.03563382104039192, -0.019189776852726936, -0.012577632442116737, -0.013781189918518066, 0.026566311717033386, 0.020911909639835358, 0.02781282551586628, 0.053938526660203934, 0.0194545891135931, 0.0015139722963795066, -0.0357731431722641, -0.005088387057185173, 0.004257760010659695, 0.04332628846168518, -0.012149352580308914, -0.04734082147479057, 0.018029984086751938, -0.01322091929614544, -0.059820450842380524, -0.03677783161401749, -0.006745075341314077, -0.02209635078907013, -0.012663901783525944, -0.0059855030849576, 0.016270749270915985, -0.00725028058513999, 0.03019685670733452, 0.010252268984913826, -0.06314245611429214, -0.005512078758329153, -0.016377074643969536, -0.0014438428916037083, 0.029021194204688072, -0.015355946496129036, 0.02559172362089157, -0.04241044819355011, 0.010147088207304478, -0.016036594286561012, 0.023162752389907837, 0.047236304730176926, 0.0166736152023077, 0.01226564310491085, -0.015224735252559185, -0.01298521552234888, -0.008012642152607441, 0.028470756486058235, -0.013741613365709782, 0.019896863028407097, 0.01720179058611393, 0.01571199856698513, 0.030143165960907936, -0.02969514951109886, 0.014739652164280415, -0.01854291744530201, -0.045576371252536774, -0.04516203701496124, 0.02147211693227291, 0.007073952350765467, 0.008106761611998081, -0.01828523352742195, 0.002731812885031104, -0.04545339569449425, 0.019007619470357895, 0.03504781052470207, 0.037705861032009125, -0.0045634908601641655, 0.0070000626146793365, 0.0037205498665571213, 0.005224148277193308, -0.017060590907931328, -0.04246727377176285, -0.006265614647418261, -0.015374364331364632, -0.03380871191620827, -0.005029333755373955, 0.007065227720886469, 0.003886009333655238, 0.008613690733909607, -0.012133199721574783, 0.005556005053222179, -0.021959641948342323, 0.04834386706352234, 0.03787781298160553, -0.057815466076135635, 0.015909207984805107, -0.03855409845709801, 0.0018244135426357388, 0.04186264052987099, -0.054983459413051605, 0.006219237111508846, 0.03494301065802574, 0.023722950369119644, 0.0312604121863842, 0.05597991123795509, -0.030345493927598, 0.016615940257906914, -0.0207205917686224, 0.055960651487112045, -0.012713379226624966, -0.0261109359562397, 0.014332456514239311, -0.017245708033442497, -0.06636268645524979, 0.00592504907399416, 0.04649018123745918, -0.018362276256084442, 0.009620632976293564, -0.0044480785727500916, -0.0014729035319760442, 0.015621249563992023, 0.0367378331720829, -0.011857259087264538, -0.045088741928339005, 0.0006832792423665524, 0.02601524256169796, -0.02120809443295002, 0.018104318529367447, 0.008069046773016453, 0.013658273033797741, 0.004183551296591759, -0.04133244603872299, 0.05436890944838524, 0.009334285743534565, -0.014695074409246445, -0.011054124683141708, 0.009796642698347569, -0.008759389631450176, -0.06399217247962952, -0.0028859861195087433, -0.008736967109143734, -0.003506746841594577, 0.008123806677758694, 0.008794951252639294, -0.02940259501338005, 0.009597218595445156, -0.02197900228202343, -0.02082076109945774, 0.023915970697999, -0.059058744460344315, -0.010253551416099072, 0.024443935602903366, -0.029604850336909294, 0.008135135285556316, 0.03568771481513977, -0.017330091446638107, -0.003135789418593049, 0.035103678703308105, 0.0370408296585083, -0.01022601593285799, -0.045891791582107544, 0.01726667769253254, -0.008570673875510693, 0.015297998674213886, -0.015412220731377602, -0.01425748411566019, 0.031544867902994156, 0.013110813684761524, -0.057211123406887054, -0.0008968000765889883, 0.001981658162549138, -0.002101168967783451, -0.09516698867082596, -0.034693196415901184, 0.011157260276377201, 0.010063023306429386, -0.02550840750336647, 0.009959851391613483, 0.022281678393483162, -0.03908146917819977, 0.02196437120437622, 0.03520793840289116, -0.06856158375740051, -0.004901218693703413, 0.1122148334980011, -0.01498009730130434, 0.03165500983595848, -0.07618033140897751, -0.014297851361334324, 0.02150021120905876, 0.005999598652124405, -0.013493427075445652, 0.013868110254406929, 0.00079053093213588, 0.006475066766142845, 0.000955471652559936, -0.03403160721063614, -0.02295752801001072, 0.0041635241359472275, -0.03955964744091034, -0.04943346977233887, 0.00032474088948220015, 0.039174411445856094, -0.011974001303315163, 0.008057610131800175, 0.03809700161218643, -0.041719768196344376, 0.037615906447172165, -0.035932306200265884, 0.008293192833662033, -0.03261689469218254, -0.023902395740151405, -7.811257091816515e-05, -0.011328466236591339, -0.026476409286260605, 0.055370282381772995, 0.03128054738044739, -0.014991461299359798, 0.017835773527622223, 0.01642710715532303, 0.029273470863699913, -0.012139911763370037, 0.01371818222105503, -0.013113478198647499, -0.04071088507771492, 0.0233455840498209, -0.019497444853186607, -0.01747158169746399, 0.02493683062493801, 0.024074571207165718, -0.03614620864391327, -0.025289475917816162, -0.04030011221766472, -0.046772539615631104, 0.009969661012291908, 0.003724620910361409, 0.007474626414477825, -0.04855594411492348, 0.04697829484939575, 0.010695616714656353, 0.027944304049015045, -0.003937696572393179, -0.011591222137212753, -0.011533009819686413, 0.03215765953063965, -0.04699324443936348, -9.356102236779407e-05, -0.01535400003194809, -0.010238519869744778, 0.002703386126086116, 0.04759520664811134, 0.0074842446483671665, -0.04050430282950401, -0.028402622789144516, -0.03205197677016258, 0.011288953013718128, 0.006053865421563387, 0.04641448333859444, 0.005652922671288252, -0.018560705706477165, 0.02581481821835041, 0.00962467584758997, -0.017888177186250687, -0.026476262137293816, -0.005547264125198126, 0.012222226709127426, -0.004069746006280184, -0.020438821986317635, 0.01929863728582859, -0.0053736320696771145, 0.02221786603331566, -0.007175051141530275, 0.003961225971579552, -0.012380941770970821, -0.0040277824737131596, 0.009086307138204575, 0.012202796526253223, 0.018483169376850128, 0.017530532553792, 0.0422886498272419, 0.04987001419067383, 0.003722204128280282, 0.06421508640050888, -0.016258088871836662, -0.027659112587571144, 0.004458434879779816, -0.02898143045604229, -0.014475414529442787, 0.032039571553468704, -0.025734663009643555, -0.01585981249809265, 0.04900333285331726, -0.06422552466392517, -0.0007134959450922906, -0.04035528376698494, 0.03290264680981636, -0.0018848407780751586, 0.0068516512401402, 0.00032433189335279167, -0.002669606124982238, -0.017596688121557236, -0.026878179982304573, 0.014075388200581074, 0.020072080194950104, -0.00295435544103384, -0.01918656937777996, -0.007689833641052246, 0.039347097277641296, 0.0026605715975165367, 0.011779646389186382, 0.04189120978116989, -0.03846775367856026, -0.01993645168840885, 0.04546443000435829, 0.05682912468910217, -0.012384516187012196, -0.004507445730268955, 0.007476931903511286, -0.01160018052905798, 0.006559243891388178, 0.04354899004101753, 0.006185194011777639, 0.028355205431580544, -0.006518798414617777, -0.029528537765145302, 0.06740271300077438, -0.052158474922180176, 0.0025031850673258305, -0.005957300774753094, 0.00500349560752511, 0.022637680172920227, -0.0027129461523145437, -0.011677206493914127, -0.042732879519462585, -0.0021236639004200697, -0.1499215066432953, 0.02914350852370262, -0.031246500089764595, -0.027244996279478073, -0.006904688663780689, 0.01088196225464344, 0.01271661464124918, -0.0430884025990963, -0.020760131999850273, -0.006593034137040377, -0.0007962957606650889, -0.031729113310575485, 0.052976224571466446, -0.03149586543440819, 0.0392388291656971, 0.023318620398640633, -0.01383691094815731, 0.02858218550682068, 0.023135144263505936, 0.026421336457133293, 0.00027594034327194095, -0.03901490569114685, 0.008533132262527943, -0.03802476078271866, -0.011105065234005451, -0.028275510296225548, 0.04846742004156113, 0.021237077191472054, -0.027375172823667526, -0.02717825025320053, -0.031243441626429558, -0.021638689562678337, 0.024066096171736717, 0.05689090117812157, -0.04352620989084244, 0.03599394112825394, 0.05153508856892586, 0.002263782313093543, 0.047110624611377716, 0.006084555760025978, 0.003244618885219097, -0.0015037712873890996, 0.027960799634456635, -0.013650861568748951, 0.03281615301966667, 0.012363187968730927, 0.02162906341254711, -0.010951842181384563, -0.02786285988986492, 0.03754381462931633, 0.01957041770219803, -0.017010418698191643, -0.008339766412973404, 0.0755641758441925, 0.023412147536873817, -0.005748848430812359, -0.05465301498770714, -0.02190011739730835, 0.0054182386957108974, 0.032733004540205, -0.05342638120055199, 0.009907999075949192, -0.02370712347328663, -0.015652501955628395, -0.011254304088652134, -0.019827252253890038, -0.021032121032476425, -0.02607329562306404, -0.0008710312540642917, -0.06800976395606995, -0.017296750098466873, 0.015312970615923405, -0.015649013221263885, -0.016449443995952606, -0.012058117426931858, 0.002104945247992873, 0.020476385951042175, 0.014795565977692604, -0.02145536057651043, -0.028734024614095688, -0.041212357580661774, -0.008211270906031132, 0.033569078892469406, -0.0033273063600063324, -0.02339683100581169, 0.0421740785241127, -0.009677124209702015, -0.006869456730782986, -0.016001028940081596, 0.029614608734846115, -0.06062136963009834, -0.011824233457446098, 0.012096629478037357, -0.028248939663171768, -0.03703905642032623, 0.012119539082050323, -0.041021380573511124, 0.01975782960653305, -0.028443211689591408, 0.020459437742829323, 0.0073023103177547455, -0.06498327851295471, -0.004016770515590906, 0.06460512429475784, -0.053343966603279114, 0.03865537419915199, -5.4113028454594314e-05, -0.008642046712338924, -0.009384138509631157, -0.037736788392066956, -0.035090748220682144, 0.018596891313791275, -0.008763385005295277, 0.040228284895420074, 0.03811536356806755, -0.034618355333805084, -0.004665717948228121, 0.04813361540436745, -0.004303373862057924, 0.00795511994510889, -0.017838604748249054, 0.00563138909637928, -0.03171280398964882, -0.0259436946362257, 0.004301885142922401, -0.02739236131310463, 0.03270035237073898, 0.009064823389053345, -0.0363747663795948, 0.02325567975640297, 0.03453107923269272, -0.012906554155051708, 0.028347544372081757, 0.01234712265431881, 0.030589573085308075, 0.0024874424561858177, -0.0173872709274292, 0.0247347354888916, 0.004171399865299463, 0.02350561134517193, -0.05499064922332764, -0.023146219551563263, -0.012485259212553501, -0.0228674728423357, 0.013267520815134048, 0.021304689347743988, -0.018937893211841583, -0.0260267723351717, -0.022532619535923004, 0.0030378480441868305, -0.008528024889528751, -0.030528495088219643, -0.009305189363658428, -0.0074027362279593945, -0.020641637966036797, 0.006984233390539885, 0.04300186410546303, -0.033014994114637375, -0.006089311558753252, 0.04753036051988602, -0.036625705659389496, -0.04691743850708008, -0.007467558141797781, 0.0652017593383789, -0.03861508145928383, -0.00741452956572175, 0.003471594536677003, 0.016132064163684845, 0.01570185460150242, 0.018733495846390724, -0.019025148823857307, 0.003490244736894965, -0.017714614048600197, -0.003447450464591384, 0.015267218463122845, 0.015076974406838417, -0.002631498035043478, 0.005311752203851938, 0.014075293205678463, 0.0026123111601918936, 0.011874910444021225, 0.0714355856180191, 0.06941138952970505, 0.022251378744840622, 0.01972009800374508, 0.04719123989343643, 0.023544959723949432, 0.017852554097771645, 0.01843070052564144, -0.05294886603951454, -0.008682304993271828, 0.010625398717820644, 0.0428495928645134, 0.002173527143895626, 0.06291069090366364, 0.024296458810567856, 0.008714474737644196, 0.06520587205886841, 0.015627536922693253, 0.04247526824474335, 0.0009774811333045363, 0.00738496845588088, -0.024803027510643005, 0.013228596188127995, -0.037615202367305756, -0.028807995840907097, 0.012890785001218319, -0.01587829552590847, -0.01928863860666752, 0.0011809614952653646, -0.026926854625344276, -0.020252779126167297, -0.010968486778438091, -0.015348547138273716, 0.008559435606002808, -0.009286923334002495, 0.0014621232403442264, 0.03831499442458153, 0.016517579555511475, 0.037184324115514755, -0.041231196373701096, 0.03757374733686447, -0.039465345442295074, -0.04308579862117767, 0.0011091071646660566, -0.029794104397296906, 0.008459310978651047, -0.01713281124830246, -0.016625113785266876, -0.05582521855831146, -0.0415986105799675, 0.028725938871502876, 0.04966316372156143, 0.012718678452074528, -0.025533588603138924, 0.013822318986058235, -5.168768620933406e-05, 0.02616700902581215, -0.06113629788160324, -0.03175340220332146, 0.03593592345714569, -0.04014921560883522, -0.020605407655239105, 0.02186705358326435]} + } + } + } +}' diff --git a/docs/ES/ES_8.18/README__ES查询相关.md b/docs/ES/ES_8.18/README__ES查询相关.md new file mode 100644 index 0000000..ee7866c --- /dev/null +++ b/docs/ES/ES_8.18/README__ES查询相关.md @@ -0,0 +1,701 @@ +# Elasticsearch 查询相关 + +## 根据商品ID查询 + +```json +GET /uat_spu/_search +{ + "query": { + "term": { + "_id": "3588136" + } + } +} +``` + +## 查label_id + +```json +GET /uat_spu/_search +{"query":{"bool":{"must":[{"term":{ "platform_sku_essaone": true }},{"term":{"label_id_list":166}}]}}} +``` + +## collapse折叠 + +```json +GET /spu/_search +{ + "_source": ["_id", "name_zh", "goods_id", "*"], + "size": 1000, + "query": { + "match": { + "name_zh": { + "query": "园艺" + } + } + }, + "collapse": { + "field": "goods_id", // 按 goods_id 字段折叠分组 + "inner_hits": { + "_source": ["_id"], + "name": "top_docs", // 自定义内部结果名称 + "size": 3, // 每组取1个文档 + "sort": [{"_score": "desc"}] // 按评分降序排序 + } + }, + "sort": ["_score"] // 确保外层排序兼容折叠功能 +} +``` + +## 在架、某平台商品数 + +```json +GET /uat_spu/_search +{ + "track_total_hits": 100000, + "query": { + "bool": { + "filter": [ + { + "term": { + "platform_sku_essaone": true + } + }, + { + "term": { + "platform_rule_essaone": true + } + }, + { + "terms": { + "goods_copyright": [ + "1", + "2", + "3" + ] + } + } + ] + } + } +} +``` + +## ID查询 + +```json +GET /uat_spu/_search +{ + "query": { + "term": { + "_id": "3302275" + } + } +} +``` + +## 商品名搜索 + +```json +GET /spu/_search +{ + "_source": { + }, + "size": 1000, + "query": { + "match": { + "name_zh": { + "query": "园艺工具四件套", + "boost": 111.0 + } + } + }, + "aggs" :{ + "goods_agg": { + "terms": { + "field": "goods_id", + "size": 100 + }, + "aggs": { + "top_hits": { + "top_hits": { + "size": 1, + "sort": [{"_score": "desc"}] + } + } + } + } + } +} +``` + +## phrase搜索 + +```json +GET /uat_spu/_search +{ + "_source":["id","goods_id","name_zh"], + "query":{ + "multi_match": { + "_name": "base_query", + "fields": [ + "name_zh^2.0", + "goods_keyword_zh^1.0", + "category_name_zh^1.0", + "sale_category_keyword_zh^1.0", + "sub_name_zh^1.0" + ], + "query": "戏水玩具" + } + } +} +``` + +## aggs聚合查询 + +```json +GET /spu/_search +{ + "_source": { + "excludes": [ + "embedding_name_zh", + "embedding_name_ru", "*" + ], + "includes": ["_id", "name_zh"] + }, + "size": 1000, + "query": { + "match": { + "name_zh": { + "query": "园艺" + } + } + }, + "aggs" :{ + "goods_agg": { + "terms": { + "field": "goods_id", + "size": 100 + }, + "aggs": { + "top_hits": { + "top_hits": { + "size": 1, + "sort": [{"_score": "desc"}] + } + } + } + } + } +} +``` + +## 检查某个字段是否有值 +```json +GET /uat_spu/_search +{ + "track_total_hits": true, + "size": 0, // 不返回 hits,只返回总数 + "query": { + "exists": { + "field": "goods_keyword_zh" + } + } +} +``` +如果是nested字段,要这么查: +```json +GET /uat_spu/_search +{ + "track_total_hits": true, + "size": 0, // 只看总数 + "query": { + "nested": { + "path": "embedding_pic_h14", + "query": { + "exists": { + "field": "embedding_pic_h14.vector" // 或 url,只要子文档里任意字段有值 + } + } + } + } +} +``` + +```json +``` + +## 分词测试 + +### ik_smart分词器 + +```json +POST spu/_analyze +{ + "analyzer": "ik_smart", + "text": "14寸第4代-眼珠实身冰雪公仔带手动大推车,搪胶雪宝宝" +} +``` + +### ik_max_word分词器 + +```json +POST spu/_analyze +{ + "analyzer": "ik_max_word", + "text": "14寸第4代-眼珠实身冰雪公仔带手动大推车,搪胶雪宝宝" +} +``` + +### query_ansj分词器 + +```json +POST spu/_analyze +{ + "analyzer": "query_ansj", + "text": "14寸第4代-眼珠实身冰雪公仔带手动大推车,搪胶雪宝宝" +} +``` + +### index_ansj分词器 + +```json +POST spu_test/_analyze +{ + "analyzer": "index_ansj", + "text": "14寸第4代-眼珠实身冰雪公仔带手动大推车,搪胶雪宝宝" +} +``` + +## 查商品名 + +```json +GET /spu/_search +{ + "_source": { + "includes": [ + "name_zh", + "category_name_zh", + "sub_name_zh", + "label_id_list", + "brand_id", + "category_id", + "price_range", + "on_sell_days_boost" + ] + }, + "collapse": { + "field": "goods_id", + "inner_hits": { + "name": "top_hits", + "size": 1, + "_source": false // 避免返回完整_source + } + }, + "from": 0, + "query": { + "function_score": { + "query": { + "bool": { + "minimum_should_match": 1, + "should": [ + { + "multi_match": { + "_name": "base_query", + "fields": [ + "name_zh^2.0", + "goods_keyword_zh^1.0", + "category_name_zh^1.0", + "sale_category_keyword_zh^1.0", + "sub_name_zh^1.0" + ], + "minimum_should_match": "66%", + "query": "网球", + "tie_breaker": 0.301 + } + } + ] + } + } + } + }, + "size": 1000, + "track_scores": true +} +``` + +# 配置相关 + +## 查看索引信息 + +```bash +GET /_cat/indices/spu?v +``` + +```bash +GET /spu/_mapping +``` + +```bash +GET /spu/_settings +``` + +## 设置刷新时间 + +```json +PUT /spu/_settings +{ + "refresh_interval": -1 +} +``` + +```json +PUT /uat_spu/_settings +{ + "refresh_interval": "600s" +} +``` + +## 设置preload + +```json +POST uat_spu/_close +PUT uat_spu/_settings +{ + "index.store.preload": [] +} + +PUT uat_spu/_settings +{ + "index.store.preload": ["vex", "veq"] +} +# ["nvd", "dvd", "tim", "doc", "dim"] + +POST uat_spu/_open + +``` + +## 修改分片数目 +主分片的数目(number_of_shards)只能创建索引的时候修改 + + +## 查看索引的分片数量、大小分布 +```json +GET _cat/indices/uat_spu?v&s=store.size:desc +GET _cat/shards/uat_spu +``` + +## 类别查询:索引中该类别总数 + +```json +GET /spu/_search +{ + "track_total_hits": 10000000, + "query": {"terms": { + "sale_category_all": [37619] + }} +} +``` + +## 类别查询:模拟平台规则 + +除了类别限定,包括: +1. essaone平台展示过滤 +2. 非专属商品 +3. status 2 4 5 +4. goods_copyright 1,2,3 + +```json +GET /spu/_search +{ + "track_total_hits": 10000000, + "aggs": { + "unique_count": { + "cardinality": { + "field": "goods_id" + } + } + }, + "collapse": { + "field": "goods_id" + }, + "query": { + "bool": { + "filter": [ + { + "bool": { + "minimum_should_match": 1, + "should": [ + { + "term": { + "platform_sku_essaone": true + } + }, + { + "bool": { + "must": [ + { + "term": { + "platform_rule_essaone": true + } + }, + { + "bool": { + "must_not": { + "exists": { + "field": "platform_sku_essaone" + } + } + } + } + ] + } + } + ] + } + }, + { + "bool": { + "must_not": { + "exists": { + "field": "buyer_id" + } + } + } + }, + { + "terms": { + "sale_category_all": [37619] + } + }, + { + "terms": { + "status": [2,4,5] + } + }, + { + "terms": { + "goods_copyright": [ + "1", + "2", + "3" + ] + } + } + ] + } + } +} +``` + +## 关键词查询 + +```json +GET /spu/_search +{ + "size": 1000, + "from": 0, + "_source": { + "includes": ["name_zh","goods_keyword_zh","sub_name_zh","category_name_zh","goods_keyword_zh","sale_category_keyword_zh"] + }, + "query": { + "multi_match": { + "query": "遥控车", + "fields": ["name_zh^3.0", "goods_keyword_zh^1.0", "category_name_zh^1.0", "sale_category_keyword_zh^1.0", "sub_name_zh^1.0"], + "minimum_should_match": "64%", + "tie_breaker": 0.3, + "_name": "base_query" + } + }, + "track_scores": true, + "collapse": { + "field": "goods_id" + } +} +``` + +## 慢查询日志 + +```json +PUT /spu,spu_test/_settings +{ + "index.search.slowlog.threshold.query.warn": "1s", + "index.search.slowlog.threshold.query.info": "800ms", + "index.search.slowlog.threshold.query.debug": "600ms", + "index.search.slowlog.threshold.query.trace": "400ms", + "index.search.slowlog.threshold.fetch.warn": "500ms", + "index.search.slowlog.threshold.fetch.info": "400ms", + "index.search.slowlog.threshold.fetch.debug": "200ms", + "index.search.slowlog.threshold.fetch.trace": "100ms" +} +``` + +```bash +GET /spu,spu_test/_settings?include_defaults=true&filter_path=**.slowlog +``` + +--- + +# 一些问题 + +有一个商品,只命中了"玩具"、没有命中"遥控",两个词命中一个词(注意是所有的字段 总共只命中一个词,玩具命中多次,但是没有任何一个字段有"遥控"),minimum_should_match应该没有达到76%吧,76%是按照什么算的?为什么命中了这个查询条件? + +```json +"multi_match": { + "_name": "base_query", + "fields": [ + "name_zh^2.0", + "goods_keyword_zh^1.0", + "category_name_zh^1.0", + "sale_category_keyword_zh^1.0", + "sub_name_zh^1.0" + ], + "minimum_should_match": "76%", + "query": "遥控玩具", + "tie_breaker": 0.3 +} +``` + +tie_breaker 导致 + +```json +GET /spu/_search +{ + "_source": { + "excludes": [ + "embedding_name_zh", + "embedding_name_ru", "*" + ], + "includes": ["_id", "name_zh"] + }, + "size": 1000, + "query": { + "match": { + "name_zh": { + "query": "园艺" + } + } + }, + "aggs" :{ + "goods_agg": { + "terms": { + "field": "goods_id", + "size": 100 + }, + "aggs": { + "top_hits": { + "top_hits": { + "size": 1, + "sort": [{"_score": "desc"}] + } + } + } + } + } +} + + +商品搜索查询模板 +```json +GET /spu/_search +{ + "_source": { + "includes": [ + "name_zh" + ] + }, + "aggs": { + "category_stats": { + "terms": { + "field": "sale_category_one_all", + "size": 100 + } + }, + "spu_attr_stats": { + "terms": { + "field": "attribute_option_list", + "size": 50 + } + }, + "unique_count": { + "cardinality": { + "field": "goods_id" + } + } + }, + "collapse": { + "field": "goods_id" + }, + "from": 0, + "query": { + "function_score": { + "boost_mode": "multiply", + "functions": [ + { + "filter": { + "term": { + "is_video": true + } + }, + "weight": 1.05 + } + ], + "query": { + "bool": { + "filter": [ + { + "terms": { + "status": [2,4,5] + } + } + ], + "must": [ + { + "bool": { + "minimum_should_match": 1, + "should": [ + { + "multi_match": { + "_name": "base_query", + "fields": [ + "name_en^3.0", + "goods_keyword_en^1.0", + "category_name_en^1.3", + "sale_category_keyword_en^1.0", + "sub_name_en^1.0" + ], + "minimum_should_match": "75%", + "operator": "AND", + "query": "changshen flashing toys", + "tie_breaker": 0.9 + } + }, + { + "knn": { + "_name": "knn_query", + "field": "embedding_name_zh", + "k": 40, + "num_candidates": 120, + "query_vector": [...] + } + } + ] + } + } + ] + } + }, + "score_mode": "sum" + } + }, + "size": 1000, + "sort": [ + { + "_score": { + "order": "desc" + } + } + ], + "track_scores": true +} +``` \ No newline at end of file diff --git a/docs/ES/ES_8.18/README__分词相关.md b/docs/ES/ES_8.18/README__分词相关.md new file mode 100644 index 0000000..15f79a5 --- /dev/null +++ b/docs/ES/ES_8.18/README__分词相关.md @@ -0,0 +1,120 @@ + + +工厂搜索 依赖于关键词召回、没有做语义召回和精排,加上语义召回和精排则成本过高,所以对分词效果仍然很依赖。badcase: q=锦鸿 无法召回 锦鸿达 +1. 虽然商品搜索已经不强依赖于分词效果,但是工厂搜索仍然对分词效果有很大依赖,所以进行了优化。 +2. 优化内容: + 1) index_ansj + 自定义词典(需要配置自定义词典。 不配置自定义词典的时候,index_ansj分词结果和query_ansj完全一致,配置自定义词典时,index_ansj 将 ) + 2) ansj自定义词典 补充属性词 + + + + + +| Query | IK_Smart 分词结果 | IK_Max_Word 分词结果 | +|---------|---------------------------------------------|--------------------------------------------------| +| 锦鸿达 | 锦, 鸿达 | 锦, 鸿达 | +| 锦鸿 | 锦, 鸿 | 锦, 鸿 | +| 14寸 4代 | 14寸, 4代 | 14, 寸, 4, 代 | +| q=14寸第4代-眼珠实身冰雪公仔带手动大推车,搪胶雪宝宝 | 14寸, 第, 4代, 眼珠, 实, 身, 冰雪, 公, 仔, 带, 手动, 大, 推车, 搪, 胶, 雪, 宝宝 | 14, 寸, 第, 4, 代, 眼珠, 实, 身, 冰雪, 公仔, 带, 手动, 大, 推车, 搪, 胶, 雪, 宝宝 | +| 金毛犬-狗狗系列积木套 | 金毛犬, 狗狗, 系列, 积木, 套 | 金毛犬, 狗狗, 系列, 积木, 套 | + + + +| Query | query_ansj 分词结果 | index_ansj 分词结果 | +|---------|------------------------------------------|--------------------------------------------------| +| 锦鸿达 | 锦, 鸿达 | 锦, 鸿达, 鸿, 达 | +| 锦鸿 | 锦鸿 | 锦鸿, 锦, 鸿 | +| q=14寸第4代-眼珠实身冰雪公仔带手动大推车,搪胶雪宝宝 | 14寸, 第, 4代, 眼珠, 实, 身, 冰雪, 公仔, 带, 手动, 大, 推车, 搪, 胶, 雪, 宝宝 | 14寸, 寸, 第, 4代, 代, 眼珠, 眼, 珠, 实, 身, 冰雪, 冰, 雪, 公仔, 公, 仔, 带, 手动, 手, 动, 大, 推车, 推, 车, 搪, 胶, 雪, 宝宝, 宝 | +| 金毛犬-狗狗系列积木套 | 金毛犬, 狗狗, 系列, 积木, 套 | 金毛犬, 金毛, 金, 毛, 犬, 狗狗, 狗, 系列, 系, 列, 积木, 积, 木, 套 | + + +ansj 插件自定义词典补充属性词后: +| Query | query_ansj 分词结果 | index_ansj 分词结果 | +|---------|------------------------------------------|--------------------------------------------------| +| 锦鸿达 | 锦, 鸿达 | 锦, 鸿达, 鸿, 达 | +| 锦鸿 | 锦鸿 | 锦鸿, 锦, 鸿 | +| q=14寸第4代-眼珠实身冰雪公仔带手动大推车,搪胶雪宝宝 | 14寸, 第, 4代, 眼珠, 实身, 冰雪, 公仔, 带, 手动, 大, 推车, 搪胶, 雪, 宝宝 | 14寸, 寸, 第, 4代, 代, 眼珠, 眼, 珠, 实身, 实, 身, 冰雪, 冰, 雪, 公仔, 公, 仔, 带, 手动, 手, 动, 大, 推车, 推, 车, 搪胶, 搪, 胶, 雪, 宝宝, 宝 | +| 金毛犬-狗狗系列积木套 | 金毛犬, 狗狗, 系列, 积木, 套 | 金毛犬, 金毛, 金, 毛, 犬, 狗狗, 狗, 系列, 系, 列, 积木, 积, 木, 套 | + + + + +## ik分词器的问题: + +```bash +POST spu/_analyze +{ + "analyzer": "ik_smart", + "text": "14寸第4代-眼珠实身冰雪公仔带手动大推车,搪胶雪宝宝" +} + +POST spu/_analyze +{ + "analyzer": "ik_max_word", + "text": "14寸第4代-眼珠实身冰雪公仔带手动大推车,搪胶雪宝宝" +} + +# ik分词器的问题: +# ik_max_word 结果是: 14 寸 第 4 代 +# 期望是能分出多种形式: 14 寸 14寸 第 4 代 4代 +# ik_smart +# 结果是: 14寸 第 4代 +# 因此 14寸 4代 都无法召回原始文档。 +``` + + +## ansj分词器的问题: + +### 1. index_ansj不符合预期 +index模式(type=index_ansj)不符合预期 :type=index_ansj type=query_ansj 结果永远都是一样的。 +https://github.com/NLPchina/elasticsearch-analysis-ansj/issues/235 + +已解决:需要配置自定义词典 + +### 2. 特殊符号分词粘连问题 +特殊符号(减号)会跟后面的词粘连到一起,导致搜索减号后面的词,无法匹配: + +```bash +GET /_cat/ansj?text=狗狗系列-柴犬积木&type=index_ansj +{ +"name": "-柴", +"nature": "nrf", +"offe": 4, +"realName": "-柴", +"synonyms": null +}, + +GET /_cat/ansj?text=狗狗系列-哈士奇犬&type=index_ansj +{ +"name": "-哈士奇", +"nature": "nrf", +"offe": 4, +"realName": "-哈士奇", +"synonyms": null +}, +``` + +这样的话,如果搜索“柴犬”、“哈士奇”,就不能命中上面的句子。 + +暂时解决办法是: +```json + "analyzer": { + "index_ansj": { + "type": "custom", + "char_filter": ["hyphen_to_space"], + "tokenizer": "index_ansj" + }, + "query_ansj": { + "type": "custom", + "char_filter": ["hyphen_to_space"], + "tokenizer": "query_ansj" + } + } +``` + + + + + + + diff --git a/docs/ES/ES_8.18/README__性能优化.md b/docs/ES/ES_8.18/README__性能优化.md new file mode 100644 index 0000000..5d7de03 --- /dev/null +++ b/docs/ES/ES_8.18/README__性能优化.md @@ -0,0 +1,701 @@ + + + +# 性能优化TODO + + +1. 主分片个数设置为12 / 16(暂定 16),replaca保持为0 +2. 缩减索引&预加载内存(3年前的不做向量索引,在uat上 水哥已经做了,索引大小已经从120G减少到61G)。 之后设置预加载(UAT上面已经做了): +```json +POST uat_spu/_close +PUT uat_spu/_settings +{ + "index.store.preload": [] +} + +PUT uat_spu/_settings +{ + "index.store.preload": ["vex", "veq"] +} +PUT uat_spu/_settings +{ + "index.store.preload": ["nvd", "dvd", "tim", "doc", "dim"] +} +# ["nvd", "dvd", "tim", "doc", "dim"] + +POST uat_spu/_open +``` +3. 段优化 (在索引稳定后): +POST /spu/_forcemerge?max_num_segments=1 。这将每个分片内的 Lucene 段合并到最少(理想是1个) +4. UAT索引迁出。 + + +# old + +## 当前主要问题 + +### 1. 按goods_id聚合/去重问题(collapse相关) + +当前采用collapse实现,但存在以下问题: + +#### 1.1 加inner_hits的性能问题 + +我暂时放弃了 inner_hits,但是其实对inner_hits功能有较强的需求,是否有替代办法:能满足 按 goods_id 聚合、也能得到聚合下的原始文档ID、同时能满足分页需求。 + +**对应案例:** + +将下面的"商品搜索实际案例"中的: + +```json +"collapse": { + "field": "goods_id" +} +``` + +替换为: + +```json +"collapse": { + "field": "goods_id", + "inner_hits": { + "_source": false, + "name": "top_docs", + "size": 4 + } +} +``` + +可以看到耗时明显增加,耗时 330ms 增加到 3565ms。 + +#### 1.2 分页不准的问题 + +**背景:** ES的分页是基于索引文档的顺序,而不是折collapse叠后的顺序,这可能导致深度分页时的性能问题或结果不一致。 + +这样会带来两个问题: + +##### a) total不准(total是collapse之前的个数) +我现在的方案是,aggs 再补充一项,计算一个按照 goods_id 的去重数,以此作为 total,从而得到准确的分页。 +( 也可以使用 cardinality 。 cardinality 提供的事近似计数。 希望快速估算唯一值数量,应该使用 cardinality ) + +见下面案例中的 aggs 中的 unique_count + +##### b) from不准 +相关资料提示只是“深度分页时”不准,比如结果跟前面的页内内容重复。但是我试了一些请求,还没找到过重复的情况。 + +并且,商品搜索因为有精排,只要请求的内容位于top1000,则会从ES获得top1000的所有结果,所以top1000内的内容不会有分页不准的问题。 + +而对于工厂搜索,我测试了一些请求,也还没有发现分页内内容跟前面的页的内容重复的情况。 + +所以ES内部实现的from已经是collapse之后的 + +### 2. ES配置优化 + +还有哪些要注意的。 + +## 实际案例 + +### 商品搜索实际案例(简化后) + +```json +GET /spu/_search +{ + "_source": { + "includes": [ + "name_zh" + ] + }, + "aggs": { + "unique_count": { + "cardinality": { + "field": "goods_id" + } + }, + "category_stats": { + "terms": { + "field": "sale_category_one_all", + "size": 10 + } + }, + "certification_stats": { + "terms": { + "field": "goods_certification_type_list", + "size": 10 + } + }, + "deliver_day_stats": { + "terms": { + "field": "deliver_day", + "size": 10 + } + }, + "label_stats": { + "terms": { + "field": "label_id_list", + "size": 10 + } + }, + "material_stats": { + "terms": { + "field": "goods_main_material", + "size": 10 + } + }, + "moq_stats": { + "terms": { + "field": "purchase_moq", + "size": 10 + } + }, + "package_lang_stats": { + "terms": { + "field": "goods_package_lang", + "size": 10 + } + }, + "package_type_stats": { + "terms": { + "field": "package_type", + "size": 10 + } + }, + "spu_attr_stats": { + "terms": { + "field": "attribute_option_list", + "size": 10 + } + } + }, + "collapse": { + "field": "goods_id" + }, + "from": 0, + "query": { + "function_score": { + "boost_mode": "multiply", + "functions": [ + { + "filter": { + "term": { + "label_id_list": 156 + } + }, + "weight": 1.1 + }, + { + "filter": { + "term": { + "is_video": true + } + }, + "weight": 1.2 + } + ], + "query": { + "bool": { + "filter": [ + { + "term": { + "platform_sku_essaone": true + } + }, + { + "term": { + "platform_rule_essaone": true + } + }, + { + "bool": { + "should": [ + { + "bool": { + "must_not": { + "exists": { + "field": "auth_level_list" + } + } + } + }, + { + "term": { + "auth_level_list": "1" + } + } + ] + } + }, + { + "terms": { + "status": [2,4,5] + } + }, + { + "terms": { + "goods_copyright": ["1","2","3"] + } + } + ], + "must": [ + { + "bool": { + "minimum_should_match": 1, + "should": [ + { + "multi_match": { + "_name": "base_query", + "fields": [ + "name_zh^2.0", + "goods_keyword_zh^1.0", + "category_name_zh^1.0", + "sale_category_keyword_zh^1.0", + "sub_name_zh^1.0" + ], + "minimum_should_match": "66%", + "query": "合金车", + "tie_breaker": 0.3 + } + } + ] + } + } + ] + } + }, + "score_mode": "max" + } + }, + "size": 1000, + "track_scores": true +} +``` + +### 工厂搜索实际案例(简化后) + +```json +GET /spu/_search +{ + "_source": [ + "id", + "goods_id", + "brand_id", + "name_zh" + ], + "aggs": { + "unique_count": { + "cardinality": { + "field": "brand_id" + } + }, + "category_stats": { + "terms": { + "field": "sale_category_one_all", + "size": 10 + } + }, + "sale_market_stats": { + "terms": { + "field": "supplier_main_market_list", + "size": 10 + } + } + }, + "collapse": { + "field": "brand_id" + }, + "from": 222, + "query": { + "bool": { + "filter": [ + { + "term": { + "platform_sku_essaone": true + } + }, + { + "term": { + "platform_rule_essaone": true + } + }, + { + "bool": { + "should": [ + { + "bool": { + "must_not": { + "exists": { + "field": "auth_level_list" + } + } + } + }, + { + "term": { + "auth_level_list": "1" + } + } + ] + } + }, + { + "terms": { + "status": [2,4,5] + } + }, + { + "terms": { + "goods_copyright": [ + "1", + "2", + "3" + ] + } + } + ], + "must": [ + { + "bool": { + "minimum_should_match": 1, + "should": [ + { + "multi_match": { + "fields": [ + "brand_name_zh^10.0", + "name_zh^2.0", + "supplier_name^8.0" + ], + "minimum_should_match": "66%", + "query": "义乌市童吉拉", + "tie_breaker": 0.3 + } + } ] + } + } + ] + } + }, + "size": 20 +} +``` + + +### ES 索引配置方面,为提升查询性能,是否需要将副本数设置为1。 +但是为了不影响写入性能,在每次全量前,先关闭副本,全量写入完成后再打开副本。 +```json +PUT /spu_test/_settings +{ + "number_of_replicas": 1 +} +``` + + +### 预热 +2025/6/26 今天早上7点多一次查询(q=木质手工艺品玩具) ES查询阶段耗时20多秒,但是第二次查询就只要几百ms,改变query耗时也正常。 + + +目前已经设置慢查询日志: + +PUT /spu,spu_test/_settings +{ + "index.search.slowlog.threshold.query.warn": "10s", + "index.search.slowlog.threshold.query.info": "5s", + "index.search.slowlog.threshold.query.debug": "2s", + "index.search.slowlog.threshold.query.trace": "500ms", + "index.search.slowlog.threshold.fetch.warn": "1s", + "index.search.slowlog.threshold.fetch.info": "800ms", + "index.search.slowlog.threshold.fetch.debug": "500ms", + "index.search.slowlog.threshold.fetch.trace": "200ms" +} + + +PUT /spu,spu_test/_settings +{ + "index.search.slowlog.threshold.query.warn": "1s", + "index.search.slowlog.threshold.query.info": "800ms", + "index.search.slowlog.threshold.query.debug": "600ms", + "index.search.slowlog.threshold.query.trace": "400ms", + "index.search.slowlog.threshold.fetch.warn": "500ms", + "index.search.slowlog.threshold.fetch.info": "400ms", + "index.search.slowlog.threshold.fetch.debug": "200ms", + "index.search.slowlog.threshold.fetch.trace": "100ms" +} + +动态调整日志级别 (无需重启) +通过集群设置 API 临时调整: +PUT /_cluster/settings +{ + "transient": { + "logger.index.search.slowlog": "info" + } +} + +验证配置是否生效 +GET /spu,spu_test/_settings?include_defaults=true&filter_path=**.slowlog + +日志文件 +logs/.log + + + + +## 慢查询记录 + + +### 07/02 早上 7:45~7:47,100个里面又有8个超过1.5S的, 4个超过5S , 2个超过14S + +#### 8888888946992436 +2025-07-02 07:45:32,092 - INFO - [REQ: 8888888946992436 UID: 10639] REQUEST POST structure: {"keyword":"плащ","kt":"kwd","page":1,"size":100,"request_id":8888888946992436,"extra":{"userId":10639,"businessPlatform":"essa"}} + +2025-07-02 07:45:46,981 - INFO - [REQ: 8888888946992436 UID: 10639] qt:kwd total:14.889394521713257ms TIMING: QA=46ms, queryEncoding=0ms, userProfile=1ms, ES=14824ms, BgeReranking=1ms, BizReranking=1ms, Reranking=2ms, total=14889ms, sku_id_list_filling=12ms + +2025-07-02 07:45:46,968 - INFO - [REQ: 8888888946992436 UID: 10639] ES_query_timing # ProductKeywordSearch # 14824.28 # {"size":1000,"from":0,"_source":{"includes":["name_zh","is_star","category_name_zh","sub_name_zh","label_id_list","is_video","brand_id","category_id","sale_category_all","price_range","on_sell_days_boost","ru_name"]},"query":{"function_score":{"query":{"bool":{"must":[{"bool":{"should":[{"multi_match":{"query":"плащ","fields":["name_ru^2.0","goods_keyword_ru^1.0","category_name_ru^1.0","sale_category_keyword_ru^1.0","sub_name_ru^1.0"],"minimum_should_match":"66%","tie_breaker":0.3,"_name":"base_query"}},{"knn":{"field":"embedding_name_ru","query_vector":[-0.035206761211156845,0.020660383626818657,-0.04898383840918541,0.01842888817191124,-0.059921182692050934,-0.013516250066459179,0.003757030935958028,0.014033733867108822,-0.027964092791080475,0.01029364112764597,-0.00787576287984848,0.02625346928834915,-0.01542199682444334,0.026301803067326546,0.052108507603406906,-0.050406284630298615,0.00483988830819726,0.04060962051153183,0.009472930803894997,-0.0005112694925628603,0.004651694558560848,0.0034800730645656586,0.018641093745827675,0.029394179582595825,0.020360751077532768,0.001675301929935813,-0.005129559896886349,-0.000619593309238553,-0.04827551171183586,-0.00630217557772994,0.020039061084389687,0.018405847251415253,0.034706272184848785,-0.08860606700181961,-0.04726770892739296,-0.032688140869140625,-0.018302561715245247,0.011481991037726402,-0.046269889920949936,0.014546985737979412,0.003089814679697156,0.010171250440180302,-0.011071375571191311,-0.01992928236722946,0.021175755187869072,0.01124000083655119,0.0372454971075058,-0.034685004502534866,-0.01343931071460247,0.02121714875102043,-0.023612814024090767,0.03798554837703705,0.06504618376493454,-0.009450038895010948,0.005906036589294672,0.030142072588205338,-0.03246299922466278,-0.030096540227532387,-0.0849074274301529,-0.020739320665597916,-0.03408554196357727,-0.0029811616986989975,-0.023305756971240044,0.027784742414951324,0.04067830741405487,0.109839528799057,-0.0005762992077507079,0.018221285194158554,-0.007281845901161432,-0.04129931703209877,-0.04749192297458649,-0.0005632156971842051,0.0058455271646380424,-0.004661038983613253,-0.05732613801956177,0.007009096443653107,0.05625062435865402,-0.025481490418314934,0.013432115316390991,0.005354376044124365,0.048216819763183594,-0.010861121118068695,0.0279295165091753,0.001105348696000874,-0.015214173123240471,-0.013066167943179607,-0.05451373755931854,0.004907973110675812,-0.041388705372810364,0.011942931450903416,0.025908607989549637,-0.004652232397347689,0.011163195595145226,-0.056879933923482895,-0.029385222122073174,0.005944914650171995,0.010291633196175098,0.009789329022169113,0.04474876821041107,0.009474224410951138,0.019974328577518463,-0.012655979953706264,-0.020499292761087418,-0.015026221051812172,0.031605109572410583,-0.026804130524396896,0.023546280339360237,0.055264607071876526,0.04840846732258797,-0.018858103081583977,0.004723322577774525,-0.01294822245836258,0.0012377514503896236,0.01827247440814972,0.025621123611927032,-0.023270349949598312,-0.014992653392255306,0.01914968341588974,0.015052393078804016,-0.013205647468566895,0.0169048048555851,0.004617445170879364,0.016027752310037613,-0.01378362812101841,-0.012757807970046997,-0.0346602164208889,-0.015302776359021664,-0.028003660961985588,0.0269561018794775,0.0047284201718866825,0.02838684618473053,0.03655833378434181,-0.01723506674170494,-0.005107777193188667,0.00955332349985838,-0.028216000646352768,0.022160036489367485,-0.011552958749234676,0.0027140516322106123,-0.06404043734073639,0.03287180885672569,0.06553228199481964,-0.03408421576023102,-0.01947455108165741,0.01903623901307583,-0.030194343999028206,0.08181223273277283,-0.001817873097024858,-0.013434878550469875,0.01553320698440075,0.008037151768803596,-0.0016663833521306515,0.061162009835243225,0.002955813892185688,0.031158601865172386,-0.015486419200897217,-0.023676788434386253,0.01596381515264511,0.013413977809250355,0.003498759353533387,-0.014206847175955772,0.06292533874511719,-0.005962688941508532,-0.010250173509120941,0.010891546495258808,-0.06812363117933273,0.019118888303637505,0.0033251780550926924,-0.011573049239814281,-0.019931120797991753,0.025516562163829803,-0.030447019264101982,0.02210240252315998,0.0037979227490723133,0.01469342689961195,0.010654212906956673,0.05843355879187584,0.010645532049238682,0.04514821618795395,-0.05915722995996475,-0.03231963887810707,-0.0037186243571341038,-0.015574388206005096,-0.053289689123630524,-0.062142301350831985,0.032532062381505966,-0.004566668067127466,-0.0005688689998351038,0.012460852973163128,-0.0002137328847311437,-0.03864103928208351,-0.053204890340566635,-0.003222765401005745,-0.0375785157084465,0.013661065138876438,0.036554817110300064,-0.005308432504534721,-0.021835779771208763,0.01610834337770939,-0.024434847757220268,0.019568176940083504,0.021495573222637177,0.027674177661538124,0.012535114772617817,-0.030019603669643402,-0.0057942504063248634,-0.028912071138620377,-0.017957061529159546,0.061209600418806076,-0.022746963426470757,0.004394537769258022,0.03157713636755943,-0.007674273569136858,0.0009010087815113366,-0.027206333354115486,-0.012480284087359905,-0.0025779965799301863,0.051328953355550766,0.01902339980006218,0.013034356757998466,-0.006923840846866369,-0.01160359662026167,0.021379830315709114,0.03169575333595276,0.040882863104343414,-0.0033913704100996256,0.01899077370762825,0.08345057815313339,-0.010554501786828041,-0.03491298854351044,-0.057687703520059586,0.04501834139227867,-0.008133002556860447,-0.02618131972849369,-0.029568562284111977,0.002545944880694151,-0.001665174262598157,0.03253322094678879,0.0024745927657932043,-0.006849205121397972,-0.05318983271718025,-0.025619570165872574,0.014735052362084389,0.02763821743428707,-0.007577501703053713,0.0063603585585951805,-0.00365810701623559,0.025731217116117477,0.03233180195093155,-0.022458139806985855,0.024351079016923904,0.011603618040680885,-0.03997845575213432,-0.043126173317432404,0.024063793942332268,0.0016773768002167344,0.04188883677124977,-0.009149405173957348,-0.01712734065949917,-0.001971685793250799,0.007741072215139866,0.030701320618391037,-0.02069244161248207,0.03917993977665901,0.023362010717391968,-0.05359603092074394,-0.07414817065000534,0.04290693253278732,0.025545785203576088,-0.023132413625717163,-0.029064863920211792,-0.018788963556289673,-0.0072210486978292465,-0.021664045751094818,-0.02780369482934475,0.010197662748396397,-0.029631970450282097,-0.06248059496283531,0.056149572134017944,0.03446534276008606,0.012978330254554749,0.020114615559577942,0.014626489952206612,0.0014688351657241583,0.007488865405321121,0.0018029020866379142,-0.026877358555793762,-0.05628906562924385,0.023198025301098824,-0.05422384664416313,-0.018185559660196304,-0.016266608610749245,0.07812158763408661,0.014885681681334972,-0.03208523988723755,0.024400467053055763,-0.023752763867378235,-0.14391297101974487,0.013684358447790146,-0.00910066906362772,-0.003774787997826934,0.002778866793960333,-0.007355159148573875,-0.049925338476896286,0.0068326424807310104,-0.015949470922350883,0.04995362088084221,0.02202575094997883,-0.050666406750679016,-0.017593706026673317,0.005538220517337322,0.010944854468107224,0.00591089203953743,-0.03195786848664284,-0.0350082665681839,0.04533974826335907,-0.04418160021305084,-0.058949049562215805,-0.024030668660998344,0.06094866618514061,0.006638273596763611,-0.011429576203227043,0.028663814067840576,-0.018866879865527153,-0.01470297109335661,-0.07419563084840775,-0.0006075186538510025,-0.01832914724946022,0.055656205862760544,-0.005896612536162138,0.06476810574531555,-0.002154070418328047,0.039329275488853455,0.03643323481082916,0.02897184155881405,0.012239593081176281,-0.013209196738898754,0.01667504385113716,-0.020171934738755226,-0.007978314533829689,0.002015035366639495,0.0060122255235910416,-0.0005796809564344585,-0.022573299705982208,0.010048048570752144,-0.028690429404377937,-0.0049275285564363,0.011733840219676495,-0.027727371081709862,0.00846127886325121,-0.012962596490979195,-0.018655503168702126,-0.004388416651636362,-0.0027830314356833696,0.021990278735756874,-0.010932429693639278,0.055302660912275314,-0.02620832622051239,-0.01626540906727314,0.022029872983694077,0.041417475789785385,-0.018135935068130493,0.023432670161128044,-0.014476905576884747,-0.021904973313212395,0.05106840282678604,-0.009241272695362568,0.008491065353155136,-0.009605452418327332,-0.010890216566622257,-0.020538344979286194,-0.03786062076687813,-0.018376335501670837,0.005948869977146387,-0.022558849304914474,-0.029248986393213272,-0.09795139729976654,0.0022951881401240826,-0.02722097747027874,-0.02994513511657715,0.02718617580831051,0.010087048634886742,-0.03410033509135246,0.006080645136535168,0.04884191229939461,0.022310344502329826,0.23470163345336914,0.05436817556619644,0.015961380675435066,-0.003585796570405364,0.04928544908761978,-0.015531239099800587,-0.03634936735033989,0.013561204075813293,-0.0127008818089962,-0.04123814404010773,0.04028059169650078,-0.022995449602603912,-0.05858377367258072,-0.025912167504429817,0.002051947871223092,0.028178082779049873,-0.024679195135831833,-0.033295053988695145,0.057560041546821594,0.012898346409201622,-0.001159863779321313,-0.05980786308646202,-0.009578239172697067,-0.006334761623293161,0.008928714320063591,-0.023135699331760406,-0.020989403128623962,0.03972852602601051,-0.0281743835657835,-0.0030933714006096125,-0.030967606231570244,-0.023228729143738747,0.04275300353765488,-0.003396248444914818,-0.021202215924859047,-0.036934223026037216,0.002650831826031208,-0.027669982984662056,-0.02926342748105526,0.023184143006801605,-0.03600231930613518,-0.04196419566869736,0.028035933151841164,-0.012389490380883217,-0.025327419862151146,0.004440063610672951,0.02531650848686695,0.006087713409215212,-0.010013606399297714,0.0007868186803534627,0.01828184723854065,-0.04047589749097824,-0.01882169395685196,0.01670665293931961,-0.0018401563866063952,-0.06178411841392517,-0.004959224723279476,-0.009559997357428074,-0.03630327060818672,0.019544923678040504,0.03323837369680405,0.0019047134555876255,-0.055654801428318024,0.0120793916285038,0.024345638230443,0.04413655027747154,0.038333743810653687,-0.03837909549474716,0.036039143800735474,0.03441465646028519,-0.025983402505517006,0.020418977364897728,0.0023564579896628857,-0.03032052516937256,0.008935485035181046,-0.002342129359021783,-0.023637691512703896,0.04967671260237694,0.0023628254421055317,0.017998643219470978,-0.013052172027528286,-0.020086176693439484,-0.021621353924274445,0.01856628805398941,-0.004594834987074137,5.3746927733300254e-05,0.02068163827061653,0.011181456036865711,0.004704579710960388,-0.06800582259893417,-0.025769870728254318,0.031559403985738754,-0.03243835270404816,-0.042171161621809006,-0.033968374133110046,-0.028492704033851624,0.030332721769809723,0.013217239640653133,-0.05065273120999336,0.0012672850862145424,0.01903768628835678,-0.01986546255648136,-0.0302716176956892,-0.046229422092437744,0.012420049868524075,-0.057180698961019516,0.011192794889211655,-0.011805238202214241,-0.009777616709470749,0.027752839028835297,0.009869647212326527,0.022393478080630302,-0.014004047028720379,-0.03816772252321243,0.02939590811729431,-0.022599423304200172,0.06637869030237198,0.0007234956719912589,0.04250507056713104,0.01874270848929882,-0.034795913845300674,-0.03439943492412567,-0.012029746547341347,-0.026585975661873817,-0.02341972105205059,-0.08398526161909103,-0.001064875046722591,0.010337086394429207,-0.027291441336274147,0.04357384517788887,-0.022910315543413162,-0.028094787150621414,-0.058925777673721313,0.03177836537361145,0.06688185781240463,-0.007260899059474468,0.07961610704660416,0.01818729378283024,0.04384874179959297,0.0069672237150371075,-0.03676052391529083,-0.026600651443004608,-0.009718179702758789,0.02413475140929222,0.002316404366865754,0.013218769803643227,0.025685036554932594,-0.0267532616853714,-0.0005175225087441504,0.008881115354597569,0.00849118735641241,0.021110543981194496,0.01012480165809393,-0.04864375665783882,0.026049554347991943,-0.033437345176935196,0.01862046681344509,0.015985814854502678,-0.04058758541941643,-0.034810714423656464,0.002337781013920903,0.023734498769044876,0.01936843805015087,0.024209536612033844,-0.011239565908908844,0.004950506146997213,0.02515280991792679,0.031176459044218063,-0.007186027243733406,-0.06590321660041809,-0.01442632731050253,-0.03848455473780632,-0.05621578171849251,0.021169142797589302,0.0638895109295845,0.014107379131019115,-0.001493399846367538,-0.0025435914285480976,-0.006533127278089523,-0.03929860144853592,0.026615334674715996,-0.04061077907681465,0.018028495833277702,-0.01668223924934864,-0.0038626976311206818,0.026101356372237206,-0.03197198361158371,-0.0065635270439088345,0.0019417291041463614,-0.0024077303241938353,0.009724567644298077,0.12885814905166626,-0.042364951223134995,-0.015280397608876228,0.0021025585010647774,0.005213343538343906,0.028361251577734947,0.008384518325328827,-0.005955472122877836,-0.025096453726291656,-0.020202528685331345,-0.06277716904878616,0.0037493319250643253,-0.011746613308787346,-0.009712602011859417,0.011140778660774231,0.013527371920645237,0.021172339096665382,-0.003329736879095435,-0.005730032920837402,0.015588180162012577,-0.01058022491633892,-0.061124950647354126,-0.027063122019171715,0.011708902195096016,-0.037272900342941284,0.04661867022514343,0.051509588956832886,-0.032604824751615524,-0.01939493976533413,-0.04458850622177124,-0.025845350697636604,0.08357544243335724,-0.03925212100148201,0.02475445531308651,0.001424501882866025,0.036441098898649216,-0.0008853881736285985,-0.0065232799388468266,-0.008607328869402409,0.0036739481147378683,0.013437087647616863,-0.0005483806598931551,0.013671726919710636,-0.010975610464811325,0.0252169668674469,0.004811613820493221,0.03503024950623512,0.008273469284176826,-0.04754671826958656,-0.0032335694413632154,-0.020629990845918655,0.020103249698877335,0.05603678897023201,-0.009146715514361858,0.047989606857299805,-0.02159910649061203,-0.008421017788350582,0.06128425896167755,0.029185334220528603,-0.013512684032320976,0.022962575778365135,0.01999785378575325,-0.030678022652864456,0.012006080709397793,0.02959463745355606,0.033092010766267776,-0.015923049300909042,-0.009248358197510242,-0.002102521015331149,0.0006527969962917268,0.05228109285235405,-0.011770941317081451,0.03377839922904968,0.0016989668365567923,-0.049906544387340546,0.01880759932100773,-0.0570840910077095,-0.004508663900196552,-0.012727982364594936,-0.009242513217031956,-0.003627593396231532,-0.02874729037284851,-0.004071712028235197,0.0028062432538717985,0.011863901279866695,0.013188064098358154,0.004998673684895039,0.02011021599173546,0.0007077555055730045,-0.034099280834198,-0.008439776487648487,-0.041815366595983505,-0.02208874374628067,0.004590209573507309,-0.005805503576993942,0.023512832820415497,0.027854664251208305,0.027635710313916206,-0.030326588079333305,-0.02209583669900894,-0.02466949261724949,-0.03720000013709068,0.04560352489352226,-0.00042570539517328143,-0.02821272797882557,-0.0056007071398198605,0.0023014284670352936,-0.013366803526878357,-0.014828696846961975,-0.02920413762331009,-0.0011925845174118876,-0.048540111631155014,-0.021844858303666115,-0.03979949280619621,0.04372791945934296,0.008035936392843723,-0.057898178696632385,-0.013198129832744598,0.04429883509874344,0.0064583527855575085,0.03409983962774277,0.013824653811752796,0.009123317897319794,0.025508053600788116,0.008969003334641457,0.03677615150809288,0.008993231691420078,-0.02603071555495262,0.030776629224419594,0.012125672772526741,0.0314396433532238,-0.011129194870591164,0.043794889003038406,-2.519373083487153e-05,-0.01874178647994995,0.005505834240466356,-0.018103158101439476,-0.01456343661993742,-0.04242011159658432,-0.00860234722495079,-0.006875118240714073,-0.003689249511808157,-0.035918280482292175,-0.005150370299816132,0.02011486329138279,0.038744986057281494,-0.025435179471969604,-0.033850330859422684,0.04369243234395981,0.010407148860394955,0.0490582212805748,0.044982362538576126,-0.02326131798326969,0.03907119110226631,0.013851706869900227,0.0053246659226715565,0.02681494876742363,-0.021451245993375778,-0.011437231674790382,-0.022223282605409622,0.03694619610905647,0.010058378800749779,-0.020366022363305092,0.027209483087062836,0.020124191418290138,-0.014966033399105072,-0.011139456182718277,0.0030029986519366503,-0.003157819854095578,-0.07452484965324402,0.045879751443862915,-0.07768410444259644,-0.023344967514276505,-0.016970690339803696,0.03432521969079971,-0.00745960371568799,-0.04227651655673981,0.03599528595805168,-0.005419539287686348,-0.007087036035954952,0.0005111709469929338,-0.017311006784439087,-0.03848304599523544,-0.010792597196996212,0.03584851697087288,-0.017352934926748276,-0.009887761436402798,0.030739745125174522,0.0006348391762003303,0.01315715629607439,0.03991811349987984,-4.012811405118555e-05,-0.04894297942519188,0.02184920944273472,-0.002984777092933655,-0.03397710993885994,-0.0006168143008835614,0.0389326773583889,0.019963927567005157,-0.035813018679618835,-0.0035148810129612684,-0.036282654851675034,0.02323351800441742,-0.14055253565311432,-0.0011770421406254172,-0.0007910575368441641,-0.009185176342725754,-0.03751031681895256,0.018624840304255486,-0.018372859805822372,-0.05124770477414131,0.00702853687107563,0.0005150049109943211,-0.05871395766735077,-0.014960653148591518,-0.012675967067480087,-0.058344099670648575,0.051571477204561234,0.04626207798719406,0.017907535657286644,-0.012606747448444366,0.00027081245207227767,0.05110858753323555,0.0063804262317717075,-0.015924256294965744,0.05612455680966377,0.005842928774654865,0.0006801928975619376,-0.026026280596852303,0.0050106649287045,0.007201412692666054,-0.05329363793134689,-0.0049592116847634315,0.021987589076161385,-0.048969246447086334,0.04041697084903717,0.05320906266570091,0.05194704607129097,0.01754378341138363,0.030775057151913643,-0.034510236233472824,0.0018061174778267741,0.01754835620522499,0.005041847005486488,0.022270090878009796,-0.03055517002940178,-0.00565745634958148,0.008246875368058681,0.04205388203263283,0.03508912771940231,-0.02427177131175995,-0.0056594498455524445,-0.0029881615191698074,0.02105557732284069,0.03583899140357971,0.010291791521012783,0.034741733223199844,0.05260966345667839,-0.054904673248529434,-0.020404748618602753,-0.004062421154230833,-0.019812684506177902,0.07352986931800842,-0.005233615171164274,0.002713999478146434,-0.015773078426718712,-0.11096750944852829,-0.025007858872413635,0.013125421479344368,-0.050285711884498596,0.0074223908595740795,0.016822388395667076,0.007340242154896259,-0.0060745421797037125,-0.04604845866560936,0.00123889883980155,-0.03444620966911316,0.00013031024718657136,0.008668433874845505,0.02411758340895176,-0.006479873321950436,-0.027701428160071373,-0.0237407423555851,-0.023862380534410477,0.00860349740833044,0.00012163886276539415,0.01104400772601366,-0.0016930673737078905,-0.0050847833044826984,-0.033998653292655945,0.04723867028951645,-0.039987944066524506,-0.018954621627926826,-0.013241901993751526,-0.028065815567970276,-0.008029542863368988,-0.03646733984351158,0.021735386922955513,0.021358124911785126,-0.0015480235451832414,0.013069476000964642,0.010266493074595928,-0.021802479401230812,0.001115710474550724,-0.022975051775574684,-0.012441503815352917,0.0010741831501945853,-0.037787165492773056,0.04443914443254471,0.04280896112322807,-0.01951548084616661,0.0206343624740839,-0.017379995435476303,-0.012229197658598423,0.0359145924448967,0.009906494989991188,0.03398154303431511,-0.054867222905159,-0.034222718328237534,0.027639850974082947,0.017935309559106827,-0.016600653529167175,0.04243488237261772,-0.011090008541941643,-0.0012337255757302046,0.02144838124513626,-0.04755748063325882,0.028430253267288208,0.03696008399128914,0.036666389554739,0.0034356049727648497,0.00029432112933136523,0.026047931984066963,0.026443278416991234,-0.017619002610445023,0.0034682732075452805,0.019300302490592003,0.03479965403676033,-0.016898181289434433,-0.0025240853428840637,0.05310631915926933,-0.007292068097740412,-0.008197016082704067,-0.010833573527634144,-0.0020867902785539627,0.0006007178453728557,-0.031240833923220634,-0.06258007138967514,-0.01165976095944643,-0.01575843244791031,0.008870338089764118,-0.0609193854033947,-0.03396580368280411,0.03464129939675331,-0.018931003287434578,0.016385870054364204,-0.00834841188043356,0.006441039498895407,0.02742983028292656,-0.02848666161298752,0.01015631202608347,0.02084996923804283,0.02939058467745781,0.0029071224853396416,0.0010421921033412218,-0.01346229575574398,0.010960790328681469,-0.01781773753464222,0.0054703461937606335,-0.00636809878051281,-0.030618872493505478,-0.0607629157602787,0.012134232558310032,-0.03560594469308853,0.014712122268974781,-0.02917938120663166,0.024105576798319817,0.04104112461209297,-0.017275553196668625,0.01021703239530325,-0.031021486967802048,0.07045310735702515,-0.02664598636329174,0.012743153609335423,-0.03889269381761551,-0.002920081838965416,0.015536080114543438,0.036099497228860855,0.02382378838956356,0.0014643787872046232,0.04115711897611618,0.004802360199391842,0.03452477231621742,0.035297833383083344,0.026000341400504112,0.051612429320812225,-0.01692250370979309,0.043301522731781006,0.04238201677799225,-0.013184351846575737,0.019781772047281265,-0.02296600304543972,0.0025291864294558764,0.011808125302195549,0.019398607313632965,-0.048333581537008286,-0.018061719834804535,-0.014784661121666431,-0.025583477690815926,-0.027409924194216728,0.01769193634390831,0.0412142239511013,0.010857541114091873,-0.008557923138141632,-0.00978132989257574,-0.009291511960327625,0.029456451535224915,-0.021604234352707863,-0.04070386663079262,0.016536498442292213,0.021561020985245705,-0.02611173316836357,0.03573843836784363,-0.001385204028338194,0.05891196429729462,-0.056763920933008194,-0.00040730182081460953,-0.039218366146087646,0.006287450436502695,-0.017032165080308914,0.009427487850189209,-0.002574730897322297,-0.005260271020233631,0.036468323320150375,0.02548493631184101,0.0020035214256495237,0.04824838414788246,0.030447717756032944,-0.044185418635606766,0.013747095130383968,-0.015019798651337624,-0.03475117310881615,-0.03381308913230896,0.034938208758831024,0.0029158841352909803,0.01635667309165001,0.0012723793042823672],"k":600,"num_candidates":800,"_name":"knn_query"}}],"minimum_should_match":1}}],"filter":[{"term":{"platform_sku_essa":true}},{"term":{"platform_rule_essa":true}},{"terms":{"status":[2,4,5]}}]}},"functions":[{"filter":{"term":{"label_id_list":156}},"weight":1.14},{"filter":{"term":{"label_id_list":157}},"weight":1.13},{"filter":{"term":{"label_id_list":158}},"weight":1.1},{"filter":{"term":{"label_id_list":159}},"weight":1.1},{"filter":{"term":{"label_id_list":162}},"weight":1.05},{"filter":{"term":{"label_id_list":163}},"weight":1.1},{"filter":{"term":{"label_id_list":164}},"weight":1.13},{"filter":{"term":{"label_id_list":165}},"weight":1.15},{"field_value_factor":{"field":"on_sell_days_boost","missing":1.0}},{"filter":{"term":{"is_video":true}},"weight":1.2}],"score_mode":"max","boost_mode":"multiply"}},"track_scores":true,"collapse":{"field":"goods_id"},"aggs":{"unique_count":{"cardinality":{"field":"goods_id"}}}} + + + +#### 8888886761383165 + +2025-07-02 07:46:00,929 - INFO - [REQ: 8888886761383165 UID: 15852] qt:kwd_factory total:5.89747166633606ms TIMING: QA=73ms, queryEncoding=28ms, userProfile=1ms, ES=190ms, BgeReranking=0ms, BizReranking=0ms, Reranking=0ms, total=5897ms, brand_statistics_query=5631ms + +2025-07-02 07:45:55,032 - INFO - [REQ: 8888886761383165 UID: 15852] REQUEST POST structure: {"keyword":"Double E","kt":"kwd_factory","page":1,"size":100,"request_id":8888886761383165,"extra":{"userId":15852,"businessPlatform":"essaone"}} + +2025-07-02 07:45:55,297 - INFO - [REQ: 8888886761383165 UID: 15852] ES_query_timing # FactoryKeywordSearch # 190.35 # {"query":{"bool":{"must":[{"bool":{"should":[{"multi_match":{"query":"Double E","fields":["brand_name_en^10.0","name_en^2.0","supplier_name^8.0"],"minimum_should_match":"66%","tie_breaker":0.3}},{"term":{"no":{"value":"Double E","boost":15.0}}},{"term":{"hs_no":{"value":"Double E","boost":15.0}}},{"term":{"factory_no":{"value":"Double E","boost":15.0}}},{"term":{"factory_no_buyer":{"value":"Double E","boost":15.0}}},{"term":{"supplier_code":{"value":"Double E","boost":15.0}}},{"match":{"factory_no_fuzzy":{"query":"Double E","boost":5.0}}},{"match":{"factory_no_buyer_fuzzy":{"query":"Double E","boost":5.0}}}],"minimum_should_match":1}}],"filter":[{"term":{"platform_sku_essaone":true}},{"term":{"platform_rule_essaone":true}},{"terms":{"status":[2,4,5]}}]}},"_source":["id","goods_id","brand_id","name_zh","category_name_zh","sub_name_zh","label_id_list","category_id","price_range","on_sell_days_boost","brand_name_zh","supplier_name","is_video"],"from":0,"size":100,"collapse":{"field":"brand_id"},"aggs":{"category_stats":{"terms":{"field":"sale_category_one_all","size":10}},"factory_certification_stats":{"terms":{"field":"supplier_certification_type_list","size":10}},"sale_market_stats":{"terms":{"field":"supplier_main_market_list","size":10}},"factory_category_stats":{"terms":{"field":"supplier_main_category_list","size":10}},"unique_count":{"cardinality":{"field":"brand_id"}}}} + +#### 8888886160313555 +2025-07-02 07:45:52,314 - INFO - [REQ: 8888886160313555 UID: 16341] qt:kwd total:5.246635437011719ms TIMING: QA=54ms, queryEncoding=0ms, userProfile=1ms, ES=5082ms, BgeReranking=3ms, BizReranking=5ms, Reranking=11ms, total=5247ms, sku_id_list_filling=91ms + +2025-07-02 07:45:47,067 - INFO - [REQ: 8888886160313555 UID: 16341] REQUEST POST structure: {"keyword":"домик для игр","kt":"kwd","page":1,"size":100,"request_id":8888886160313555,"extra":{"userId":16341,"businessPlatform":"essa"}} + +2025-07-02 07:45:52,222 - INFO - [REQ: 8888886160313555 UID: 16341] ES_query_timing # ProductKeywordSearch # 5082.04 # {"size":1000,"from":0,"_source":{"includes":["name_zh","is_star","category_name_zh","sub_name_zh","label_id_list","is_video","brand_id","category_id","sale_category_all","price_range","on_sell_days_boost","ru_name"]},"query":{"function_score":{"query":{"bool":{"must":[{"bool":{"should":[{"multi_match":{"query":"домик для игр","fields":["name_ru^2.0","goods_keyword_ru^1.0","category_name_ru^1.0","sale_category_keyword_ru^1.0","sub_name_ru^1.0"],"minimum_should_match":"66%","tie_breaker":0.3,"_name":"base_query"}},{"knn":{"field":"embedding_name_ru","query_vector":[-0.010469888336956501,-0.009433825500309467,-0.061066463589668274,0.015439781360328197,-0.04887380078434944,-0.025594189763069153,0.02132314071059227,0.0048728156834840775,-0.024967197328805923,-0.016300074756145477,0.026881838217377663,0.02839415892958641,-0.04787887632846832,0.008348211646080017,0.02851884812116623,-0.020819339901208878,0.03223418444395065,0.022767407819628716,0.03298615664243698,-0.02291654795408249,0.007127368822693825,0.0026097544468939304,0.03312079608440399,0.030420035123825073,0.0018665859242901206,-0.007431185804307461,0.017863251268863678,-0.001749506569467485,-0.014798518270254135,-0.01667628437280655,0.024006366729736328,-0.0035607542376965284,-0.005410423967987299,-0.051832519471645355,-0.035944465547800064,-0.021218450739979744,-0.010114893317222595,-0.028079111129045486,-0.0533841997385025,0.04635569453239441,-0.0012162572238594294,0.0279274620115757,-0.004270642530173063,-0.033846378326416016,0.029734719544649124,-0.029220541939139366,0.04269053414463997,-0.022250592708587646,-0.051402684301137924,0.00989573448896408,-0.04305187985301018,0.01834198832511902,0.047379374504089355,-0.02046145871281624,0.020443573594093323,0.054781723767519,-0.01415993645787239,-0.03219226747751236,-0.043012600392103195,-0.007893793284893036,-0.01194281131029129,-0.020178208127617836,-0.0457143560051918,0.03828400745987892,0.021164067089557648,0.0818348154425621,0.031024565920233727,0.02610183134675026,-0.023838410153985023,-0.03643917664885521,-0.04240600764751434,-0.013539587147533894,-0.033422503620386124,-0.023028532043099403,-0.03987479954957962,0.037250813096761703,0.020570218563079834,-0.03727980703115463,-0.021551992744207382,0.008813940919935703,0.013401217758655548,-0.03705735504627228,0.03132335841655731,0.013271518982946873,-0.04067348316311836,-0.025765778496861458,-0.018480906262993813,0.0351085290312767,0.01488423254340887,-0.0028665210120379925,0.009210212156176567,-0.0050658416002988815,0.030113283544778824,-0.04046862572431564,-0.026331497356295586,-0.011537943966686726,0.024856189265847206,-0.003682077629491687,0.026156049221754074,0.024270538240671158,0.006325250957161188,-0.009220371022820473,-0.030239824205636978,-0.01933831162750721,0.005819987040013075,-0.02187834493815899,0.005806083790957928,0.03514980152249336,0.005680521950125694,0.0015755404019728303,0.018678558990359306,0.01218269020318985,0.005215473007410765,0.006414385512471199,0.009669029153883457,-0.03394971787929535,-0.01018771342933178,0.012081903405487537,-0.011565321125090122,0.017589492723345757,0.03712606802582741,0.014796657487750053,0.03933378681540489,-0.008113304153084755,0.006041175685822964,0.03321465477347374,-0.019459377974271774,0.0314057394862175,-0.0029240089934319258,0.0013709934428334236,0.028914669528603554,0.06471606343984604,0.007002886850386858,-0.012658798135817051,-0.04317999258637428,-0.01186620444059372,-0.0003211218863725662,0.020922966301441193,-0.003911396488547325,-0.053643420338630676,0.0021015468519181013,0.047227781265974045,-0.00348144443705678,-0.036834292113780975,0.03750087320804596,-0.008714203722774982,0.024695945903658867,-0.003665439784526825,-0.02675502561032772,-0.022107955068349838,-0.011632490903139114,0.020526042208075523,0.02676335908472538,0.03569071739912033,0.017682095989584923,-0.01834474503993988,0.0018101560417562723,0.0283984262496233,0.05491636320948601,0.003809621324762702,0.0006344207795336843,-0.02211061678826809,0.004625074565410614,0.020883994176983833,0.00015821929264348,-0.02832794189453125,0.0008159314747899771,0.0272744819521904,-0.027715962380170822,-0.02472168765962124,-0.016808174550533295,-0.05462613329291344,0.01775122433900833,0.014273782260715961,0.0008496608934365213,0.008177808485925198,0.0421871617436409,0.0045638978481292725,0.042220886796712875,-0.06000344827771187,-0.015377563424408436,0.011407480575144291,-0.03646248206496239,-0.01713411509990692,-0.04549218714237213,0.008391285315155983,0.002547923941165209,0.003514634445309639,-7.575080962851644e-05,0.027596233412623405,-0.03235990181565285,-0.02061750926077366,0.026209574192762375,-0.027568824589252472,0.045371562242507935,0.005951724015176296,-0.00968377199023962,-0.021565992385149002,0.013237068429589272,-0.013479852117598057,-0.0017748709069564939,0.014049606397747993,0.05706736817955971,-0.004590840544551611,-0.004989347420632839,-0.029409339651465416,-0.010748337022960186,-0.034739598631858826,0.046425726264715195,-0.04140014201402664,0.002544855233281851,0.036837805062532425,-0.037906888872385025,0.0013478754553943872,-0.041077353060245514,-0.03370291367173195,-0.018066709861159325,-0.016500622034072876,-0.010342623107135296,0.006782337557524443,-0.007797015365213156,0.011681020259857178,0.03112754039466381,0.04650038108229637,0.03888101875782013,-0.0280715674161911,0.05207274481654167,0.09879706799983978,0.02158382348716259,0.027143163606524467,-0.04732990637421608,-0.0010990563314408064,-0.02125970833003521,-0.059333719313144684,0.003452498698607087,0.009645221754908562,-0.010461045429110527,-0.006256204564124346,0.006562483962625265,-0.012693407014012337,-0.041277870535850525,-0.03793799504637718,0.009225663729012012,0.014676553197205067,-0.029448574408888817,0.019804179668426514,0.0010417350567877293,0.034564901143312454,-0.006257682107388973,-0.026684997603297234,-0.047370005398988724,-0.013308132067322731,-0.026585856452584267,-0.014774832874536514,0.013124870136380196,0.010718361474573612,-0.01895284280180931,-0.006912903394550085,-0.006600252352654934,-0.01494550984352827,0.035866040736436844,0.0033980663865804672,-0.016810467466711998,0.038974154740571976,0.061462365090847015,-0.03711969032883644,-0.04634862393140793,0.007261885795742273,0.04931870102882385,-0.008722336031496525,-0.0410168282687664,0.005162227898836136,0.010419916361570358,-0.04338258504867554,-0.0035620471462607384,-0.029630742967128754,0.0004580442910082638,-0.04241163656115532,0.04071682319045067,0.00014105312584433705,0.016499493271112442,0.015219377353787422,0.03846654295921326,0.008888534270226955,0.011078225448727608,0.034640733152627945,0.02468424290418625,-0.02980225533246994,0.03709685429930687,-0.04838785156607628,-0.022547060623764992,-0.04328358918428421,0.0513724759221077,0.020648853853344917,-0.01620667055249214,-0.0037202714011073112,-0.03920559957623482,-0.14737793803215027,-0.015798239037394524,0.009418384172022343,0.029613904654979706,0.010793381370604038,-0.01496070995926857,-0.06054462119936943,0.02468664012849331,-0.006591952871531248,0.0889967605471611,-0.005320643074810505,-0.05315868929028511,-0.012014172971248627,0.0038997710216790438,-0.003502458333969116,-0.011375060304999352,-0.00010943621600745246,-0.03431030735373497,-0.012095400132238865,-0.03467661514878273,-0.05062715709209442,-0.03093382529914379,0.022824974730610847,0.04939018934965134,-0.021028684452176094,0.004197969101369381,0.037393391132354736,-0.028176335617899895,-0.01585490256547928,-0.02675454132258892,-0.001398522756062448,0.010839952155947685,-0.0014937809901311994,0.005020319949835539,-0.0392594039440155,0.035468436777591705,0.024752793833613396,0.03639066964387894,0.022926686331629753,0.04597996547818184,0.02241627685725689,-0.0012659834465011954,-0.00739333825185895,0.02420814335346222,0.03704681247472763,-0.0196627639234066,-0.031841784715652466,-0.006799183785915375,-0.03352772817015648,0.02181745134294033,0.05579682067036629,-0.013558600097894669,0.030181091278791428,-0.006316977087408304,-0.013952523469924927,0.012330206111073494,-0.041256241500377655,0.03192669153213501,-0.01914273202419281,0.08461452275514603,-0.04409714788198471,-0.01214772742241621,0.011330503039062023,0.018481537699699402,-0.006005553063005209,0.050334520637989044,-0.002672649221494794,-0.008288771845400333,0.06209006905555725,-0.0010046516545116901,0.010663624852895737,-0.031831953674554825,0.022650688886642456,-0.0212539155036211,-0.03193394094705582,-0.012190799228847027,-0.01092712301760912,-0.016085412353277206,0.0294950008392334,-0.09827454388141632,-0.03515492379665375,-0.03178056702017784,0.011391546577215195,0.017250820994377136,-0.008856121450662613,-0.04064458608627319,-0.015738215297460556,0.006248313933610916,-0.018025370314717293,0.22370760142803192,0.006043099332600832,0.012936385348439217,-0.025930719450116158,0.06032849848270416,-0.006991071160882711,-0.011622984893620014,0.037625912576913834,-0.011367491446435452,-0.04600599780678749,-0.0017747886013239622,0.017549537122249603,-0.0005504885921254754,-0.027553657069802284,0.009912733919918537,0.04041628912091255,0.00668737106025219,-0.04864263907074928,0.056667692959308624,-0.013048314489424229,0.0067961267195641994,-0.018381819128990173,-0.02903132699429989,0.022398315370082855,0.019530439749360085,-0.02770918980240822,-0.010601629503071308,0.03488731384277344,-0.044833723455667496,0.006666871719062328,-0.0008869143784977496,-0.00881689041852951,0.04928088188171387,-0.002849663607776165,-0.03115912340581417,-0.04198518022894859,-0.005231834482401609,-0.019640298560261726,-0.023163769394159317,-0.004315787926316261,-0.04009106755256653,-0.02463514357805252,-0.0036947547923773527,0.02182174101471901,-0.0372823029756546,0.030221836641430855,0.006193005479872227,0.003403798909857869,-0.03606549650430679,-0.009063707664608955,0.022200630977749825,-0.035799380391836166,-0.0010024507064372301,0.017152471467852592,0.03343266248703003,-0.030394289642572403,-0.0015014258679002523,0.003636636072769761,-0.01756003312766552,0.020411495119333267,0.0021329200826585293,0.011021564714610577,-0.0735861286520958,0.017728058621287346,0.023705432191491127,0.05030510202050209,0.021042807027697563,-0.020785532891750336,0.0334869921207428,0.08741839975118637,-0.0117210503667593,0.0001782165199983865,0.01726897619664669,-0.016497846692800522,-0.010504627600312233,-0.01187414862215519,-0.015835637226700783,0.034667130559682846,0.02805940806865692,0.03733376786112785,0.01915065385401249,-0.02492561750113964,-0.005571269430220127,0.019386373460292816,0.008642815984785557,0.02145669236779213,0.004512604791671038,0.05554104596376419,0.0034787680488079786,-0.029752783477306366,-0.030377579852938652,-0.004558586049824953,-0.06357397139072418,-0.0061086020432412624,-0.017321696504950523,-0.008206392638385296,0.015490153804421425,0.00264244107529521,-0.050804127007722855,0.008118793368339539,0.03476586937904358,-0.025892768055200577,-0.034948062151670456,-0.026809023693203926,-0.002411295659840107,-0.06390640884637833,-0.011082773096859455,0.027057144790887833,-0.004077316261827946,0.01618964411318302,-0.0009810739429667592,0.033004630357027054,-0.029286647215485573,-0.04033875837922096,0.013788820244371891,0.002074463991448283,0.05652409419417381,-0.0017354398733004928,0.03404363989830017,-0.006880622357130051,-0.01774861477315426,-0.018313229084014893,-0.03552359342575073,-0.0241499412804842,-0.03993042930960655,-0.04111562669277191,-0.033971648663282394,0.05698266997933388,-0.023043980821967125,0.07825858145952225,0.042342230677604675,-0.03370245173573494,-0.018297547474503517,0.01990216225385666,0.06232258304953575,-0.005874479189515114,0.07475804537534714,0.017168639227747917,0.03488057479262352,0.007689229678362608,-0.003546604420989752,-0.02382161282002926,0.008269473910331726,0.05184008181095123,0.0005383225507102907,-0.03091702237725258,0.014850238338112831,-0.022906668484210968,0.005280963145196438,0.0021260471548885107,0.0075647649355232716,0.038381244987249374,0.02324162796139717,-0.052792321890592575,0.03654114156961441,0.02748439647257328,-0.026714904233813286,0.030958322808146477,0.01187271811068058,-0.03695902228355408,0.013516424223780632,0.04011475294828415,0.05052071437239647,0.058027807623147964,-0.015193523839116096,-0.028515109792351723,0.02482019178569317,0.047152336686849594,-0.004623717628419399,-0.07297758758068085,-0.022836927324533463,-0.03479558229446411,-0.07144102454185486,0.016290798783302307,0.03177016228437424,0.01441336888819933,0.022974787279963493,-0.013084933161735535,-0.005881442688405514,-0.01334321964532137,0.028493165969848633,-0.019956499338150024,-0.007063222583383322,-0.026240255683660507,0.01777167059481144,0.049458764493465424,0.0020872417371720076,-0.0036216345615684986,0.041699085384607315,0.0014556738315150142,0.010557536035776138,0.12180053442716599,0.0042220959439873695,-0.005183610133826733,0.0054078251123428345,-0.01075050886720419,0.02989562414586544,0.043644167482852936,-0.0026929841842502356,0.05072465538978577,-0.02767416276037693,-0.021618958562612534,0.004661609884351492,-0.05195184424519539,-0.008984383195638657,-0.0016476722666993737,0.001689418568275869,0.004983874969184399,-0.016171567142009735,0.03625691309571266,0.0010089717106893659,-0.01374185923486948,-0.02346370369195938,-0.0194739680737257,-0.004569245968014002,-0.0140912476927042,0.03445490077137947,0.05356881767511368,-0.021733732894062996,-0.025566138327121735,-0.00019305998284835368,-0.0100232670083642,0.018865162506699562,-0.00848840270191431,-0.044497255235910416,-0.013691495172679424,0.05164350941777229,-0.03370695188641548,-0.010106456466019154,-0.014190864749252796,-0.0003716690407600254,-0.037853680551052094,0.009384162724018097,-0.01162363775074482,0.014443009160459042,-0.022771866992115974,0.00011503294081194326,0.023730352520942688,0.019146617501974106,-0.04712327942252159,0.0008851240272633731,-0.016855042427778244,-0.013206337578594685,0.10681824386119843,-0.020240144804120064,0.0525200180709362,0.006826168857514858,-0.0027339737862348557,0.07510307431221008,0.021456290036439896,-0.042665038257837296,0.00046758705866523087,0.005679022520780563,0.0008857414941303432,0.010391597636044025,0.007729665841907263,-0.025840606540441513,-0.02985285222530365,0.007668808568269014,0.0002980357385240495,-0.016171475872397423,0.019020926207304,0.006020192988216877,0.006464902777224779,-0.026913413777947426,-0.043556589633226395,0.008232228457927704,-0.07689546048641205,-0.0052263797260820866,-0.035628072917461395,-0.02966294251382351,-0.005918087437748909,-0.03567393124103546,-0.01247942540794611,0.060361843556165695,0.002807028591632843,-0.027588142082095146,-0.007894536480307579,0.008604361675679684,0.020103173330426216,-0.07210689783096313,0.029876112937927246,-0.023141849786043167,0.0011987691977992654,-0.0008149961940944195,0.006197143346071243,0.020895564928650856,0.00037953004357405007,0.013111161068081856,-0.03845285251736641,0.0016084229573607445,-0.04168611764907837,-0.04236757382750511,0.00733993062749505,-0.03751220181584358,-0.018620682880282402,-0.021968642249703407,0.028136257082223892,0.005372560117393732,-0.010228092782199383,-0.028038909658789635,-0.0023334466386586428,-0.028629278764128685,-0.04670895263552666,-0.052376631647348404,0.03586474433541298,0.018091430887579918,-0.049946997314691544,-0.01514176744967699,0.047803860157728195,0.01699567772448063,0.015328731387853622,0.010712620802223682,0.002123685088008642,0.06415592133998871,0.024631377309560776,0.035582102835178375,0.0012244904646649957,-0.012233590707182884,0.00813966989517212,0.037902217358350754,0.029360517859458923,-0.0486132986843586,0.017687661573290825,0.03299839422106743,-0.013238496147096157,-0.013200326822698116,-0.005730216857045889,-0.01331530325114727,-0.030444618314504623,-0.033732011914253235,0.047386765480041504,-0.009842630475759506,0.005994858685880899,-0.023812925443053246,-0.01362360455095768,0.03314647823572159,0.00647759111598134,0.0250770952552557,0.0414326973259449,0.026004893705248833,0.036320049315690994,0.054730840027332306,-0.03910583257675171,0.012060780078172684,0.041371408849954605,0.002077584620565176,-0.025946158915758133,-0.025974782183766365,-0.02720918506383896,-0.007927898317575455,0.0040055844001472,-0.013832611963152885,-0.02973191626369953,0.03527991473674774,-0.009695704095065594,-0.05575500428676605,-0.03722952678799629,0.013541829772293568,-0.00865274015814066,-0.020357931032776833,0.009639723226428032,-0.0507102832198143,-0.015244240872561932,-0.019348127767443657,0.04555179551243782,0.015294121578335762,-0.007206445559859276,0.06062790006399155,-0.005111909005790949,0.004139820113778114,0.01937681809067726,0.020404402166604996,0.002552285324782133,-0.030844949185848236,0.036409102380275726,-0.006814957596361637,-0.04197080060839653,0.05024629086256027,-0.029270010069012642,0.015528818592429161,0.001503972103819251,-0.007328128442168236,-0.01840047910809517,-0.00045441105612553656,-0.0092100128531456,-0.04498742148280144,-0.009130802936851978,0.04675000160932541,0.06979136168956757,-0.04311365634202957,-0.00877243559807539,-0.0004214404325466603,0.012277666479349136,-0.14219562709331512,-0.00430926913395524,-0.021201396360993385,-0.009498199447989464,-0.017543308436870575,0.017806844785809517,-0.025756800547242165,-0.07828842848539352,0.03590783849358559,0.02816518396139145,-0.07964565604925156,0.008752426132559776,0.042080290615558624,-0.06404416263103485,0.02651718072593212,0.055071402341127396,-0.008800625801086426,-0.028176235035061836,-0.019509777426719666,0.036569271236658096,0.00906379148364067,-0.04683149978518486,0.02234005369246006,0.02516242116689682,0.023896029219031334,-0.04918082430958748,-0.0010268468176946044,-0.023550570011138916,-0.03628400340676308,-0.017949851229786873,0.04402030631899834,-0.04206490516662598,0.04107481241226196,0.04993964731693268,0.03154009208083153,0.025109808892011642,0.013614547438919544,-0.04171719774603844,-0.0031599036883562803,0.020165840163826942,-0.011632400564849377,0.03999967873096466,0.014274412766098976,-0.01187898963689804,0.032295823097229004,-0.012709599919617176,0.05827837809920311,-0.01723158359527588,-0.024798419326543808,0.0030991726089268923,0.032597899436950684,0.029943378642201424,-0.02429444156587124,0.048744626343250275,0.0011137371184304357,-0.007776426151394844,-0.034102633595466614,-0.029111959040164948,0.015030012466013432,0.04656554013490677,-0.04094461724162102,-0.011531602591276169,4.6118831960484385e-05,-0.10001746565103531,-0.010489478707313538,-0.0015569606330245733,-0.027479514479637146,0.0019341816660016775,0.013176586478948593,0.014007719233632088,-0.006951211951673031,-0.0756019651889801,-0.037204310297966,-0.025117047131061554,0.027918003499507904,0.01250455155968666,0.008491392247378826,-0.004520315211266279,-0.023112304508686066,-0.0491146594285965,0.010934853926301003,-0.009928848594427109,-0.0035737405996769667,-0.013385831378400326,0.02666373923420906,0.006644800305366516,-0.016098324209451675,0.03759223222732544,-0.028729181736707687,-0.010834852233529091,-0.020237639546394348,-0.05446283146739006,-0.02220902405679226,-0.021221645176410675,-0.03547218069434166,0.029663149267435074,-0.011989464983344078,-0.009906524792313576,-0.006016987841576338,0.009752561338245869,0.030416961759328842,-0.047963038086891174,-0.013526865281164646,0.018452998250722885,-0.021521203219890594,0.018701469525694847,0.05285897105932236,-0.0010904023656621575,0.006972190923988819,-0.03487509861588478,-0.036200184375047684,0.017229322344064713,0.006422214210033417,0.02873692847788334,-0.041057173162698746,-0.00750432163476944,0.05745010823011398,-0.007179181091487408,-0.017404083162546158,0.017651472240686417,-0.01599116250872612,0.002535711508244276,0.011545952409505844,-0.03415549546480179,0.0005909449537284672,0.01335767563432455,0.05411890894174576,0.007383115589618683,0.007445705588907003,-0.017489442601799965,0.011805353686213493,-0.012042094953358173,0.005274818744510412,0.03236418217420578,0.03646424040198326,-0.06665074825286865,-0.019605418667197227,0.05144963786005974,-0.027477338910102844,-0.03461708873510361,-0.05672290548682213,0.01851639710366726,0.024274040013551712,-0.0470280684530735,0.01059630885720253,-0.004326973110437393,-0.04125908017158508,0.0022801600862294436,-0.045498285442590714,-0.006944847758859396,0.03445719555020332,-0.009896100498735905,-0.012551878578960896,0.01959688775241375,-0.021050885319709778,0.04245401918888092,-0.037523407489061356,-0.03017435409128666,0.009188764728605747,-0.008055423386394978,-0.02664773538708687,0.012918847613036633,-0.014927655458450317,0.04965515434741974,-0.017271872609853745,-0.022227248176932335,-0.0227284487336874,-0.004705421160906553,-0.033305756747722626,0.002648882567882538,-0.005779338534921408,0.014533694833517075,-0.013593053445219994,0.04263252764940262,0.02904282882809639,-0.07667391747236252,0.022012075409293175,0.008652359247207642,0.04519110918045044,-0.01619795337319374,0.00044568892917595804,-0.02074517495930195,0.004130502697080374,0.00022689816250931472,0.053020164370536804,-0.012851173058152199,-0.024143502116203308,0.06575654447078705,0.014508445747196674,0.0024358986411243677,-0.012151635251939297,0.01383469719439745,0.041081752628088,-0.031509026885032654,0.01629532128572464,0.03418257459998131,-0.007328009698539972,0.05706708878278732,-0.0035665929317474365,0.029910331591963768,-0.030345812439918518,0.041055403649806976,-0.034993771463632584,-0.05910377576947212,0.02390240877866745,-0.0036049620248377323,-0.011457656510174274,-0.026312116533517838,-0.009664950892329216,-0.01770581677556038,-0.007549853529781103,-0.007084082346409559,-0.0038768649101257324,0.04494233801960945,0.0034482809714972973,-0.021237505599856377,0.024455199018120766,0.05279000476002693,-0.01997961848974228,0.028929967433214188,-0.01043784897774458,0.036516424268484116,-0.06251353770494461,-0.012730982154607773,-0.01633322983980179,-0.013615496456623077,-0.020573323592543602,0.02139892429113388,-0.0033865063451230526,-0.04148336127400398,0.01212544459849596,-0.015159036964178085,0.01337565016001463,0.03254852071404457,0.0395018570125103,-0.0424620695412159,0.053009994328022,0.01647733338177204,-0.007640088442713022,-0.013958015479147434,0.021169302985072136,-0.006630351766943932,-0.0018147891387343407,-0.0404183603823185],"k":600,"num_candidates":800,"_name":"knn_query"}}],"minimum_should_match":1}}],"filter":[{"term":{"platform_sku_essa":true}},{"term":{"platform_rule_essa":true}},{"terms":{"status":[2,4,5]}}]}},"functions":[{"filter":{"term":{"label_id_list":156}},"weight":1.14},{"filter":{"term":{"label_id_list":157}},"weight":1.13},{"filter":{"term":{"label_id_list":158}},"weight":1.1},{"filter":{"term":{"label_id_list":159}},"weight":1.1},{"filter":{"term":{"label_id_list":162}},"weight":1.05},{"filter":{"term":{"label_id_list":163}},"weight":1.1},{"filter":{"term":{"label_id_list":164}},"weight":1.13},{"filter":{"term":{"label_id_list":165}},"weight":1.15},{"field_value_factor":{"field":"on_sell_days_boost","missing":1.0}},{"filter":{"term":{"is_video":true}},"weight":1.2}],"score_mode":"max","boost_mode":"multiply"}},"track_scores":true,"collapse":{"field":"goods_id"},"aggs":{"unique_count":{"cardinality":{"field":"goods_id"}}}} + +#### 8888883840386376 +2025-07-02 07:45:29,565 - INFO - [REQ: 8888883840386376 UID: 9987] qt:kwd_factory total:4.385730504989624ms TIMING: QA=80ms, queryEncoding=34ms, userProfile=1ms, ES=593ms, BgeReranking=0ms, BizReranking=0ms, Reranking=0ms, total=4386ms, brand_statistics_query=3710ms + +2025-07-02 07:45:25,179 - INFO - [REQ: 8888883840386376 UID: 9987] REQUEST POST structure: {"keyword":"澳高","kt":"kwd_factory","page":1,"size":100,"request_id":8888883840386376,"extra":{"userId":9987,"businessPlatform":"trader"}} + +2025-07-02 07:45:25,854 - INFO - [REQ: 8888883840386376 UID: 9987] ES_query_timing # FactoryKeywordSearch # 592.97 # {"query":{"bool":{"must":[{"bool":{"should":[{"multi_match":{"query":"澳高","fields":["brand_name_zh^10.0","name_zh^2.0","supplier_name^8.0"],"minimum_should_match":"66%","tie_breaker":0.3}},{"term":{"no":{"value":"澳高","boost":15.0}}},{"term":{"hs_no":{"value":"澳高","boost":15.0}}},{"term":{"factory_no":{"value":"澳高","boost":15.0}}},{"term":{"factory_no_buyer":{"value":"澳高","boost":15.0}}},{"term":{"supplier_code":{"value":"澳高","boost":15.0}}},{"match":{"factory_no_fuzzy":{"query":"澳高","boost":5.0}}},{"match":{"factory_no_buyer_fuzzy":{"query":"澳高","boost":5.0}}}],"minimum_should_match":1}}],"filter":[{"term":{"platform_sku_trader":true}},{"term":{"platform_rule_trader":true}},{"bool":{"should":[{"bool":{"must_not":{"exists":{"field":"trader_buyer_ids"}}}},{"term":{"trader_buyer_ids":9987}}]}},{"terms":{"status":[2,4,5]}}]}},"_source":["id","goods_id","brand_id","name_zh","category_name_zh","sub_name_zh","label_id_list","category_id","price_range","on_sell_days_boost","brand_name_zh","supplier_name","is_video"],"from":0,"size":100,"collapse":{"field":"brand_id"},"aggs":{"category_stats":{"terms":{"field":"sale_category_one_all","size":10}},"factory_certification_stats":{"terms":{"field":"supplier_certification_type_list","size":10}},"sale_market_stats":{"terms":{"field":"supplier_main_market_list","size":10}},"factory_category_stats":{"terms":{"field":"supplier_main_category_list","size":10}},"unique_count":{"cardinality":{"field":"brand_id"}}}} + + +### 0701 启动后 第一次查询 + +2025-07-01 15:10:24,560 - INFO - [REQ: 99996874 UID: 11010] qt:kwd total:15.652546644210815ms TIMING: QA=248ms, queryEncoding=0ms, userProfile=2ms, ES=14733ms, BgeReranking=503ms, BizReranking=7ms, Reranking=514ms, total=15653ms, sku_id_list_filling=144ms + +2025-07-01 15:10:08,908 - INFO - [REQ: 99996874 UID: 11010] REQUEST POST structure: {"query":"积木车","kt":"kwd","top_k":5000,"recall_merge_output_size":5000,"rerank_size":1000,"rerank_enabled":true,"page":1,"size":100,"debug":"0","from_search_debug":1,"extra":{"userId":11010,"businessPlatform":"trader"}} + +2025-07-01 15:10:24,415 - INFO - [REQ: 99996874 UID: 11010] ES_query_timing # ProductKeywordSearch # 14732.69 # {"size":1000,"from":0,"_source":{"includes":["name_zh","is_star","category_name_zh","sub_name_zh","label_id_list","is_video","brand_id","category_id","sale_category_all","price_range","on_sell_days_boost","brand_name_zh","supplier_name"]},"query":{"function_score":{"query":{"bool":{"must":[{"bool":{"should":[{"multi_match":{"query":"积木车","fields":["name_zh^2.0","goods_keyword_zh^1.0","category_name_zh^1.0","sale_category_keyword_zh^1.0","sub_name_zh^1.0"],"minimum_should_match":"66%","tie_breaker":0.3,"_name":"base_query"}},{"knn":{"field":"embedding_name_zh","query_vector":[-0.0021524359472095966,-0.008107833564281464,-0.029764598235487938,0.0008246809593401849,-0.040078889578580856,-0.006073615048080683,0.011918029747903347,0.019061563536524773,-0.030276576057076454,-0.008857600390911102,0.015921179205179214,0.019418299198150635,-0.004340778570622206,0.032456833869218826,0.026495972648262978,-0.013638369739055634,0.009577512741088867,0.05024699121713638,-0.002644563792273402,-0.056296054273843765,-0.003823563689365983,-0.02251642569899559,0.039393797516822815,0.007878373377025127,0.033576302230358124,0.03129247575998306,-0.0017715205904096365,-0.005420100875198841,0.010666202753782272,-0.03803142532706261,0.04202716797590256,-0.0036040968261659145,-0.0028934082947671413,-0.04637492075562477,-0.0489245168864727,-0.03738679736852646,0.0038137363735586405,-0.016817262396216393,-0.04795883595943451,0.05358966439962387,-0.01840907894074917,0.002011107513681054,0.02920212596654892,-0.006401093676686287,-0.0030216253362596035,-0.0013409669045358896,0.030354607850313187,-0.014434156008064747,-0.007749649230390787,0.026039982214570045,-0.008697780780494213,0.019168002530932426,0.07524910569190979,-0.042920466512441635,-0.008408952504396439,0.013219775632023811,-0.03873486816883087,-0.05833493545651436,-0.083629310131073,-0.029803313314914703,-0.03472751006484032,0.005717243067920208,-0.0226939357817173,-0.0016026428202167153,0.02288738079369068,0.10437139123678207,-0.012227358296513557,0.001420297659933567,-0.011135675013065338,-0.0664505809545517,-0.043076127767562866,-0.0029975650832057,-0.03185959532856941,-0.01608896255493164,-0.037143900990486145,0.03871254622936249,0.02565511129796505,0.0019380551530048251,-0.051922500133514404,0.003943318501114845,0.03325793519616127,-0.02121022157371044,0.013436833396553993,0.02082972601056099,0.0055800192058086395,-0.011569220572710037,-0.019480425864458084,0.004300588276237249,-0.02139301225543022,0.052772145718336105,-0.016601400449872017,-0.01394728198647499,0.009624723345041275,-0.034984245896339417,-0.04199494421482086,-0.030347228050231934,0.003312210086733103,0.02941184490919113,0.04211102053523064,0.0008835332118906081,0.026741022244095802,0.005722839385271072,0.008748107589781284,-0.01780589111149311,-0.028155015781521797,-0.06471167504787445,0.02908491902053356,0.010580305010080338,0.005717920139431953,-0.01443113200366497,-0.007160497829318047,0.03158904239535332,0.00443205377086997,-0.0002449769526720047,0.00032021026709116995,-0.018649997189641,-0.013081124052405357,0.005840871017426252,0.022754283621907234,0.00038412288995459676,0.03662636876106262,0.0015330958412960172,0.028473608195781708,0.002789353020489216,0.013041779398918152,-0.024487949907779694,-0.005734704900532961,-0.008972971700131893,0.013888053596019745,-0.0005149265634827316,0.02040003426373005,0.029574397951364517,-0.030044572427868843,-0.006543997209519148,-0.0024162638001143932,-0.03538169339299202,0.05170788988471031,-0.008383621461689472,-0.018639560788869858,-0.05566595867276192,-0.0006145948427729309,0.06543915718793869,-0.006052026525139809,-0.05874686688184738,0.0069569977931678295,-0.05807267874479294,0.05126497521996498,-0.00788998231291771,-0.008304163813591003,-0.027954386547207832,0.013678958639502525,0.022278638556599617,0.041264116764068604,0.017783891409635544,0.024431833997368813,-0.024646008387207985,0.009298823773860931,0.008236299268901348,-0.03247912600636482,0.015482714399695396,0.00038719220901839435,0.05515728145837784,-0.004987176042050123,-0.008741161786019802,-0.0023540486581623554,-0.06015388295054436,0.06123318150639534,0.027333028614521027,0.003739637788385153,-0.01502145268023014,0.004994833376258612,-0.03815867751836777,0.024375803768634796,0.013542595319449902,0.007177951745688915,0.021070610731840134,0.0926181972026825,0.014546383172273636,0.0328536257147789,-0.05456337705254555,-0.010433388873934746,0.008905144408345222,0.010454634204506874,-0.05243987962603569,-0.04009335860610008,0.032108478248119354,0.021958496421575546,-0.028974879533052444,0.010772105306386948,0.007837618701159954,-0.04730592668056488,-0.057198088616132736,-0.005038625095039606,-0.04818981513381004,0.031043333932757378,0.03901030495762825,0.00877933669835329,-0.015933558344841003,0.006942194886505604,-0.04809608310461044,0.043025385588407516,0.0043589770793914795,0.029627831652760506,-0.0027638510800898075,0.0043422565795481205,-0.00976208969950676,-0.007741814479231834,-0.01441408321261406,0.04136406257748604,-0.030481336638331413,0.015116587281227112,0.05261996388435364,-0.010116422548890114,-0.006042817607522011,-0.023958636447787285,-0.0458344928920269,-0.02643308974802494,0.040540117770433426,0.011701489798724651,0.02358323335647583,-0.035595376044511795,-0.027484813705086708,-0.008031305857002735,0.029444141313433647,0.0028918662574142218,-0.021969232708215714,0.022328602150082588,0.08823686093091965,0.0068029602989554405,-0.02103363908827305,-0.024456510320305824,0.023317944258451462,-0.025757895782589912,-0.010184992104768753,-0.016762834042310715,0.0018494194373488426,-0.0026936104986816645,0.010300536639988422,0.052759379148483276,0.027439579367637634,-0.010008060373365879,0.022467883303761482,-0.011797384358942509,0.022044146433472633,-1.3175530511944089e-05,-0.00045528641203418374,0.030866634100675583,0.03751451522111893,-0.01813993789255619,-0.02804294228553772,0.0014048550510779023,0.004565953277051449,-0.0016563588287681341,-0.023749910295009613,-0.015372049994766712,0.021440651267766953,0.01252153143286705,-0.013254334218800068,-0.01739756017923355,-0.029223432764410973,0.017711658030748367,0.03152080997824669,-0.004094158764928579,0.04269825294613838,0.020384935662150383,-0.04358230158686638,-0.03132731094956398,0.033803541213274,0.024181393906474113,-0.04478638991713524,-0.03499162942171097,0.021012023091316223,-0.008845007047057152,-0.024362096562981606,-0.0139074781909585,-0.027427630499005318,-0.040660783648490906,-0.0196492001414299,0.06112941354513168,0.022548330947756767,0.0338263139128685,-0.03196163475513458,0.00892527773976326,-0.00610659783706069,0.027038536965847015,-0.018952051177620888,-0.014648749493062496,-0.031623926013708115,0.027128929272294044,-0.087367482483387,0.008742256090044975,-0.004130226559937,0.06409017741680145,0.012657399289309978,-0.020537547767162323,0.007053192239254713,0.012734713964164257,-0.1552649736404419,-0.03443276882171631,-0.005799517966806889,0.013326657004654408,-0.0018917110282927752,-0.006266586482524872,-0.09289218485355377,-0.02573857270181179,-0.030639585107564926,0.07345457375049591,-0.00020668204524554312,-0.05569712445139885,-0.0016944733215495944,-0.01832824945449829,-0.019985295832157135,0.010904115624725819,0.020684650167822838,-0.01103052869439125,-0.0027708131819963455,-0.03966747596859932,-0.05894359201192856,-0.00985708273947239,0.04881586506962776,0.016122115775942802,-0.010426975786685944,-0.015283441171050072,0.013112197630107403,-0.013165329582989216,-0.035223446786403656,-0.0008697658777236938,-0.02840181067585945,-0.0010744782630354166,-0.012925480492413044,0.044555746018886566,0.009398666210472584,0.061517134308815,0.03688885271549225,0.028642358258366585,-0.01860814169049263,0.022029319778084755,0.008004609495401382,0.00821618176996708,0.016734670847654343,0.006471497472375631,0.003730524331331253,-0.008796396665275097,-0.0074549890123307705,0.02069988287985325,-0.030744746327400208,-0.006338813342154026,0.0253937728703022,-0.034629128873348236,0.030959444120526314,-0.004648637492209673,-0.02333318255841732,-0.010571219027042389,0.01853341795504093,0.03412136808037758,-0.014929739758372307,0.06304692476987839,-0.08330893516540527,0.002655221149325371,0.01382172666490078,0.04286998137831688,-0.014280414208769798,0.032440152019262314,-0.021224746480584145,0.00020794977899640799,0.054403550922870636,-0.01180355902761221,-0.01072473544627428,-0.02522001601755619,0.011840219609439373,-0.014453714713454247,-0.038930755108594894,-0.006260146852582693,-0.05281693488359451,-0.05747189000248909,0.012676840648055077,-0.08696306496858597,-0.010713816620409489,0.007824697531759739,-0.02255372144281864,0.011827881447970867,-0.0065089804120361805,-0.03725752979516983,-0.018521690741181374,0.04106614366173744,0.018148278817534447,0.23312987387180328,-0.014090578071773052,0.016248833388090134,0.01127681229263544,0.05765477567911148,0.015727991238236427,0.00946797151118517,0.0031675961799919605,-0.03734290227293968,-0.03255750983953476,0.0182870514690876,0.007358734030276537,-0.022447505965828896,-0.026112454012036324,0.01635131426155567,0.04619167745113373,0.02413603663444519,-0.0407564602792263,0.09370268881320953,-0.025074772536754608,-0.00029483612161129713,-0.018697509542107582,-0.01781277358531952,0.017940673977136612,-0.02972322516143322,0.00024119814042933285,-0.022535981610417366,0.009964799508452415,-0.021998129785060883,0.024504350498318672,-0.005922492127865553,0.0021572797559201717,0.04125651344656944,0.0047308299690485,0.013808893971145153,-0.008898098953068256,-0.03205633908510208,-0.018167994916439056,0.0030818094965070486,0.007267059292644262,-0.02025766484439373,-0.02215166948735714,-0.030655503273010254,0.03830377012491226,0.005981022026389837,0.03742852807044983,0.020476529374718666,0.017463959753513336,-0.04439929872751236,0.0004590617900248617,0.0256186630576849,-0.04552275314927101,-0.009011787362396717,0.057703666388988495,-0.00494146766141057,-0.03310084342956543,0.005579948425292969,0.015488170087337494,-0.024067174643278122,0.031143829226493835,-0.022571805864572525,0.002964159706607461,-0.058006830513477325,0.0283556766808033,0.040942154824733734,0.017844954505562782,0.03505164012312889,0.0143186766654253,0.019413070753216743,0.047896355390548706,0.006573976017534733,0.02589588426053524,-0.006083318963646889,-0.05251375213265419,0.032565075904130936,0.005573251750320196,-0.029710937291383743,0.014190850779414177,0.0360872745513916,0.0035467869602143764,0.016834037378430367,-0.019506607204675674,-0.025557391345500946,0.017378561198711395,0.033644337207078934,-0.01754351332783699,-0.012809148989617825,0.01448732241988182,0.0279574953019619,-0.01765974797308445,-0.04071679338812828,0.0009586800588294864,-0.023854324594140053,-0.02147866226732731,-0.07723361998796463,-0.009058748371899128,0.040198519825935364,0.01204153336584568,-0.04439648985862732,0.011944795958697796,0.017168762162327766,-0.010023520328104496,-0.006161050871014595,-0.017953239381313324,-0.0008542825817130506,0.013084064237773418,0.030334994196891785,-0.0037808723282068968,0.014176527969539165,0.006537510547786951,0.024642817676067352,0.024845825508236885,-0.022497717291116714,0.003762215841561556,-0.033537302166223526,-0.02540391869843006,0.0312526598572731,0.0014003848191350698,0.018620852380990982,0.06406458467245102,-0.03934227675199509,-0.026771441102027893,-0.026208680123090744,-0.04102228581905365,-0.0270833857357502,-0.0371842123568058,0.03195386752486229,-0.0005223327898420393,-0.03742726892232895,0.07725945860147476,0.032983504235744476,-0.031122945249080658,-0.045543745160102844,0.032277967780828476,0.05918898805975914,-0.027791693806648254,0.06387126445770264,0.023617131635546684,0.05752670764923096,-0.02803068235516548,-0.010680115781724453,-0.022160986438393593,-0.011746326461434364,-0.008686578832566738,0.007741359528154135,-0.0062912022694945335,0.015117891132831573,-0.0504550077021122,-0.027555646374821663,0.005645196884870529,0.03199009969830513,0.04541085660457611,0.018509844318032265,-0.04988311603665352,0.0019933488219976425,0.007733427453786135,-0.009433378465473652,0.008698632940649986,-0.021730277687311172,-0.03974450007081032,0.023893440142273903,0.03154609352350235,0.033038459718227386,0.05710946395993233,-0.024973005056381226,0.016246620565652847,0.024769118055701256,0.04433866962790489,0.014308245852589607,-0.045840609818696976,0.027106719091534615,-0.019007112830877304,-0.04810561612248421,0.02759348414838314,0.08240367472171783,0.02096753567457199,-0.00416744127869606,-0.020258115604519844,-0.01906486786901951,0.013792135752737522,-0.00884083192795515,-0.01788301207125187,0.01874888874590397,-0.03870024532079697,-0.002507546916604042,0.023538006469607353,-0.019283248111605644,-0.01345799583941698,0.01689094491302967,-0.003734003519639373,-0.015246883034706116,0.10167922079563141,0.002215425716713071,-0.01618504896759987,-0.0015069530345499516,-0.03562147170305252,-0.004937139339745045,0.0007552902097813785,-0.0033826816361397505,0.004935006611049175,-0.018421879038214684,-0.0266331285238266,-0.0032839688938111067,-0.025602977722883224,-0.013660518452525139,0.00856244657188654,-0.02488720417022705,0.01565670408308506,0.010058961808681488,-0.009137501008808613,-0.007183379959315062,-0.029949260875582695,-0.016903936862945557,-0.02664032205939293,-0.0026719740126281977,-0.02189408615231514,0.03345991671085358,0.0245782732963562,-0.0582994781434536,-0.00568669056519866,0.0040232595056295395,-0.01667124032974243,0.052253250032663345,-0.0023887353017926216,-0.03843231499195099,-0.018974334001541138,0.0374433770775795,-0.029200579971075058,0.006642875727266073,0.04284786805510521,0.005079883616417646,0.044204726815223694,-0.050280727446079254,-0.0030483368318527937,0.018859531730413437,0.016609109938144684,0.04063723236322403,0.03662716597318649,0.017424730584025383,-0.05511152744293213,0.012393343262374401,-0.052537936717271805,-0.011534972116351128,0.09142953902482986,-0.037017758935689926,0.03191547840833664,-0.0011108381440863013,-0.015503648668527603,0.09541337937116623,0.04027377814054489,-0.02521558478474617,0.0025058649480342865,0.02207014337182045,-0.004655528347939253,-0.014539115130901337,0.01584828458726406,0.02960776910185814,-0.03246964141726494,-0.015777749940752983,-0.028405562043190002,-0.0325256809592247,0.04164791852235794,-0.015093624591827393,0.01791227050125599,-0.0053864638321101665,-0.062485549598932266,0.014980792067945004,-0.07676522433757782,0.01933562196791172,-0.02318069152534008,-0.03381315991282463,-0.01226354856044054,-0.029262298718094826,-0.03077603131532669,0.0043533798307180405,0.032050326466560364,-0.0032636383548378944,0.011057293973863125,0.012763677164912224,0.02708243392407894,-0.04477400332689285,-0.005059266462922096,-0.02746930904686451,-0.01495356298983097,0.012080458924174309,-0.02930055372416973,0.022455070167779922,-0.006186312064528465,0.012239658273756504,-0.056182049214839935,-0.012763277627527714,-0.03393477573990822,-0.026735682040452957,0.010735822841525078,-0.030875341966748238,-0.019251223653554916,-0.051349807530641556,0.04196283966302872,-0.029140431433916092,-0.022665003314614296,-0.028535345569252968,0.02563866414129734,-0.031149370595812798,-0.02313033491373062,-0.041975896805524826,0.033878181129693985,0.018033476546406746,-0.04503728821873665,0.01451121736317873,0.01986190304160118,-0.0112045519053936,0.0022888975217938423,0.010853433981537819,-0.03081909380853176,0.03367147967219353,0.008152400143444538,-0.008445621468126774,-0.0069310967810451984,-0.005846841726452112,0.04007423669099808,-0.010478340089321136,0.003632578067481518,-0.05679529160261154,-0.007903935387730598,0.015483321622014046,-0.005587068852037191,0.014209503307938576,0.004649599082767963,-0.004043999128043652,-0.041941024363040924,-0.0037290018517524004,-0.0003034354595001787,-0.02196478843688965,-0.0035335738211870193,-0.013874325901269913,0.010820210911333561,0.0057076942175626755,-0.03366489335894585,-0.004135465249419212,0.0280380230396986,0.03273744136095047,0.018154531717300415,0.04654344171285629,-0.037046708166599274,0.0475095771253109,0.03073061630129814,-0.009450764395296574,-0.01001717709004879,0.00536694098263979,-0.025302181020379066,0.008918129839003086,0.019043093547225,-0.011608882807195187,-0.014153755269944668,0.03197164088487625,-0.007570689544081688,-0.053325723856687546,-0.012190615758299828,-0.013835873454809189,-0.007214938290417194,-0.033833518624305725,0.02794158272445202,-0.043069664388895035,-0.005416421685367823,-0.01889304257929325,0.048966776579618454,0.0072764926590025425,0.013816933147609234,0.06535563617944717,0.006311641540378332,-0.006707347463816404,-0.0352039635181427,-0.007175379898399115,0.0071813007816672325,0.0032109459862113,0.04923095181584358,-0.0004961849772371352,-0.022697051987051964,0.0007138533401302993,-0.034034986048936844,0.016270918771624565,0.003717052284628153,0.01697886735200882,-0.01975543424487114,0.039609394967556,-0.02062390185892582,-0.06586196273565292,0.00756759662181139,0.03938873112201691,0.03567376732826233,-0.048646848648786545,-0.03521135076880455,-0.02724856324493885,0.007512927986681461,-0.14108328521251678,0.03747677803039551,-0.01291686575859785,-0.028617428615689278,-0.05360802263021469,0.02828209288418293,-0.027074536308646202,-0.054799556732177734,0.021222947165369987,-0.016730189323425293,-0.0714416578412056,-0.00894789770245552,0.04949968680739403,-0.036847881972789764,0.01872086524963379,0.06436192244291306,0.019862260669469833,-0.030302345752716064,-0.007061121519654989,0.015498452819883823,-0.00441434932872653,-0.005172411911189556,0.0715278908610344,0.031627822667360306,-0.0035775310825556517,-0.033065617084503174,0.010293131694197655,0.01225349772721529,-0.024923870339989662,0.016770552843809128,-0.006837135646492243,-0.05347704514861107,0.01712893508374691,0.08052338659763336,0.0452919527888298,0.027423730120062828,0.017372475937008858,-0.04497986659407616,-0.013707904145121574,0.0180472694337368,0.019366011023521423,0.029807746410369873,-0.0020171261858195066,0.027545781806111336,0.0005783095839433372,0.0052664210088551044,0.02249046228826046,-0.00868252757936716,-0.013710943050682545,0.009558163583278656,0.002748706843703985,0.023087885230779648,0.002986074425280094,0.029210377484560013,0.013242463581264019,-0.023239193484187126,-0.020963486284017563,-0.055765364319086075,0.024110082536935806,0.05231046304106712,-0.00956584233790636,0.02121114730834961,-0.025239259004592896,-0.0946902483701706,-0.039695486426353455,-0.005382890347391367,-0.034302305430173874,0.0018533205147832632,0.06796300411224365,0.027097562327980995,0.013307681307196617,-0.059225697070360184,-0.006225021556019783,-0.009755522944033146,0.020239073783159256,0.022693298757076263,0.0411948598921299,0.006173071917146444,-0.04946613311767578,-0.0362771637737751,-0.020803051069378853,0.025593405589461327,-0.0006749304011464119,0.003253212431445718,0.012986235320568085,-0.0032602206338196993,-0.03639553487300873,0.05997848883271217,-0.05154813826084137,0.008660460822284222,-0.016708508133888245,-0.02752944640815258,-0.024387666955590248,-0.004524093121290207,0.004924986977130175,0.007002477068454027,-0.013311495073139668,0.013337369076907635,-0.02140575833618641,-0.01811077445745468,-0.003214634954929352,0.007181718945503235,0.007522390689700842,-0.017910225316882133,-0.0013092863373458385,0.023208608850836754,0.019766826182603836,-0.0020718665327876806,0.015326851047575474,-0.01997850090265274,-0.023913022130727768,-0.027809714898467064,0.00522984191775322,-0.006423330400139093,-0.05896889045834541,-0.008351332508027554,0.037767525762319565,-0.010563126765191555,-0.04010838270187378,0.012037806212902069,0.01449983287602663,-0.008654217235744,0.03958940505981445,-0.041072919964790344,-0.020386384800076485,0.016278039664030075,0.03609130531549454,-0.00932556577026844,0.02303696796298027,-0.011356515809893608,0.01134386658668518,-0.029857710003852844,0.041478242725133896,0.02560768648982048,0.027723217383027077,-0.013846679590642452,-0.006710059009492397,0.0533745177090168,-0.004539508372545242,-0.037180494517087936,-0.05059074983000755,0.010428684763610363,-0.0013235608348622918,-0.050717439502477646,-0.02790592983365059,-0.013537339866161346,-0.037436746060848236,-0.00787926185876131,-0.03954906016588211,-0.05071116238832474,0.026204537600278854,0.002853244775906205,-0.004444602411240339,0.008540390059351921,0.0037303552962839603,0.04376672953367233,-0.027974246069788933,0.007798444014042616,-0.002806631848216057,0.01825649105012417,0.0049882205203175545,-0.008621595799922943,-0.00796885509043932,0.026042580604553223,0.001026156242005527,0.014937580563127995,-0.025604236871004105,0.01384399738162756,-0.03421280160546303,-0.01651141606271267,-0.033375389873981476,-0.010832262225449085,-0.0071794334799051285,0.03804642707109451,0.03441499173641205,-0.054669156670570374,0.021820666268467903,-0.005702161230146885,0.039233241230249405,-0.003689537523314357,0.012676684185862541,0.0074905212968587875,0.022044047713279724,0.01034513022750616,0.04489839822053909,0.0026726643554866314,-0.016389921307563782,0.0721321702003479,0.030039990320801735,0.046596869826316833,0.008214130997657776,-0.01008486095815897,0.059578366577625275,-0.005294167436659336,0.05520564317703247,0.03682423755526543,-0.024427372962236404,0.0493122823536396,-0.0029275345150381327,0.047900039702653885,-0.03625209257006645,-0.008139371871948242,-0.016370030120015144,-0.013061241246759892,-0.025937354192137718,0.018791822716593742,0.007310884539037943,-0.022234100848436356,-0.01127785537391901,-0.01773921214044094,-0.022473379969596863,-0.021747006103396416,-0.0039264364168047905,0.024716513231396675,-0.013713193126022816,-0.019176652655005455,0.007130912970751524,0.03963853791356087,-0.024430224671959877,0.052942048758268356,-0.006402516271919012,0.02781028486788273,-0.0398385263979435,0.006198063492774963,-0.02492978423833847,-0.004867245443165302,-0.06440611183643341,-0.02933618240058422,0.0036015156656503677,-0.026202373206615448,0.022264158353209496,0.0016737349797040224,0.0047467234544456005,0.015019385144114494,0.025666475296020508,-0.02535399980843067,0.03414227440953255,0.019933506846427917,0.04195677861571312,-0.062302686274051666,0.016360249370336533,-0.0017109195468947291,0.014784248545765877,0.006924598477780819],"k":600,"num_candidates":800,"_name":"knn_query"}}],"minimum_should_match":1}}],"filter":[{"term":{"platform_sku_trader":true}},{"term":{"platform_rule_trader":true}},{"bool":{"should":[{"bool":{"must_not":{"exists":{"field":"trader_buyer_ids"}}}},{"term":{"trader_buyer_ids":11010}}]}},{"terms":{"status":[2,4,5]}}]}},"functions":[{"filter":{"term":{"label_id_list":156}},"weight":1.14},{"filter":{"term":{"label_id_list":157}},"weight":1.13},{"filter":{"term":{"label_id_list":158}},"weight":1.1},{"filter":{"term":{"label_id_list":159}},"weight":1.1},{"filter":{"term":{"label_id_list":162}},"weight":1.05},{"filter":{"term":{"label_id_list":163}},"weight":1.1},{"filter":{"term":{"label_id_list":164}},"weight":1.13},{"filter":{"term":{"label_id_list":165}},"weight":1.15},{"field_value_factor":{"field":"on_sell_days_boost","missing":1.0}},{"filter":{"term":{"is_video":true}},"weight":1.2},{"filter":{"terms":{"sku_id":[2388172,2185613,2121891]}},"weight":1.2}],"score_mode":"max","boost_mode":"multiply"}},"track_scores":true,"collapse":{"field":"goods_id"},"aggs":{"unique_count":{"cardinality":{"field":"goods_id"}}}} + + + +2025-06-29 21:58:26,099 - INFO - [REQ: 7621648571687939 UID: 12883] TIMING: QA=89ms, queryEncoding=38ms, userProfile=0ms, ES=12407ms, BgeReranking=43ms, BizReranking=1ms, Reranking=44ms, total=12594ms, sku_id_list_filling=50ms + +{"size":1000,"from":0,"_source":{"includes":["name_zh","is_star","category_name_zh","sub_name_zh","label_id_list","is_video","brand_id","category_id","sale_category_all","price_range","on_sell_days_boost","brand_name_zh","supplier_name"]},"query":{"function_score":{"query":{"bool":{"must":[{"bool":{"should":[{"multi_match":{"query":"婴儿游泳叭圈","fields":["name_zh^2.0","goods_keyword_zh^1.0","category_name_zh^1.0","sale_category_keyword_zh^1.0","sub_name_zh^1.0"],"minimum_should_match":"66%","tie_breaker":0.3,"_name":"base_query"}},{"knn":{"field":"embedding_name_zh","query_vector":[-0.01478106901049614,0.013851337134838104,-0.055754996836185455,0.00896596722304821,-0.035678550601005554,0.011876722797751427,-0.0468246228992939,0.002370002679526806,-0.008833633735775948,-0.013886653818190098,0.005371053237468004,0.014607803896069527,-0.026950594037771225,0.009789489209651947,0.037642937153577805,-0.01866260915994644,0.005209847819060087,0.02765592560172081,0.023023366928100586,-0.04377084970474243,-0.022735562175512314,0.00786507222801447,-0.02201155759394169,-0.0025800715666264296,0.02735256962478161,0.008907552808523178,-0.0007465820526704192,-5.53255777049344e-05,-0.013690521009266376,-0.026607664301991463,0.00973280519247055,0.019667286425828934,-0.017879927530884743,-0.06314889341592789,-0.009382741525769234,-0.06508748978376389,-0.019463876262307167,0.006836523301899433,-0.043444592505693436,0.0657905861735344,-0.011680386029183865,-0.005935718771070242,0.015079094097018242,0.02610080875456333,0.02284662239253521,-0.014283453114330769,0.01882733218371868,-0.025137750431895256,-0.02017633244395256,-0.024488935247063637,-0.018697349354624748,0.014619751833379269,0.029269011691212654,-0.017477717250585556,0.006322234403342009,0.03211721405386925,-0.021374624222517014,-0.029504645615816116,-0.06616988778114319,-0.036163579672575,-0.013338882476091385,-0.01617359183728695,-0.04116946458816528,0.026660947129130363,0.008928346447646618,0.10984474420547485,0.010123053565621376,-0.01621401309967041,-0.027820462360978127,-0.04593786224722862,-0.038563843816518784,0.025001462548971176,0.004857074469327927,-0.0024321400560438633,-0.04466858133673668,0.05484404042363167,0.008686342276632786,-0.0003515953430905938,0.008685621432960033,-0.018227847293019295,0.047262199223041534,-0.008053619414567947,-0.01761087030172348,0.007228255737572908,-0.03889349102973938,0.02386181242763996,-0.0228823684155941,-0.022754788398742676,0.0016211157198995352,-0.0035532936453819275,-0.021663568913936615,-0.006626194342970848,0.022327415645122528,-0.035443294793367386,0.019731944426894188,0.04754151403903961,0.017493415623903275,-0.022076735273003578,0.04263211041688919,0.01102732215076685,0.019614174962043762,0.009782286360859871,-0.027961768209934235,-0.0315760001540184,0.0027029807679355145,-0.03642409294843674,0.06655669212341309,0.024716848507523537,0.01797829382121563,0.004849161021411419,0.0043105133809149265,0.006638331804424524,-0.014820436015725136,0.04238307103514671,0.024094264954328537,-0.03936127573251724,-0.05168687179684639,0.011486952193081379,-0.0034848363138735294,-0.012619306333363056,0.0060675060376524925,-8.145697938743979e-05,0.027002284303307533,-0.018612802028656006,0.020482657477259636,1.8866128812078387e-05,-0.019893649965524673,-0.0193052776157856,0.012323510833084583,0.029035022482275963,0.03360322490334511,0.05084170773625374,-0.017852783203125,0.020378144457936287,-0.01218657661229372,-0.006937084719538689,0.053081151098012924,0.03357801213860512,-0.022793013602495193,-0.02143709734082222,0.02176191657781601,0.055819615721702576,0.0038024240639060736,-0.012173552066087723,0.0005114141386002302,-0.018635105341672897,0.01824198290705681,0.0255444273352623,-0.0282748956233263,0.004239222966134548,-0.00812776479870081,4.7788598749320954e-05,0.0557871051132679,0.019567588344216347,-0.00028773516532965004,-0.02875434421002865,-0.03580142557621002,-0.002113121096044779,-0.020758362486958504,0.05183732509613037,0.017015770077705383,0.01906605437397957,-0.03805425390601158,-0.0051781125366687775,-0.02848101407289505,-0.006052127107977867,0.033519964665174484,0.03536006063222885,0.012120080180466175,0.0025614923797547817,0.0009862167062237859,-0.03235156834125519,0.02071847766637802,0.03410404548048973,0.016081364825367928,0.011789122596383095,0.01911352388560772,0.004926277324557304,0.005005321465432644,-0.043821439146995544,-0.017150579020380974,0.0077651748433709145,0.0003986236115451902,-0.008670051582157612,-0.022377822548151016,0.011790684424340725,-0.01683042012155056,-0.00673762708902359,0.008468764834105968,0.026806943118572235,-0.0197699423879385,-0.03254053369164467,-0.03715294227004051,-0.039610929787158966,-0.004791934043169022,0.006890779361128807,0.024904610589146614,-0.025197915732860565,-0.0005258696037344635,0.012641497887670994,0.015375467017292976,0.03656463697552681,0.00463845394551754,-0.012778306379914284,-0.02092798426747322,-0.009456257335841656,-0.0372374951839447,-0.05441342294216156,0.044130802154541016,0.015424227342009544,0.044802676886320114,0.0038794628344476223,-0.024197202175855637,-0.0016400220338255167,-0.06931869685649872,-0.03873330354690552,0.014769361354410648,-0.008807665668427944,0.025098230689764023,0.00847370084375143,-0.03129679709672928,-0.03269540145993233,0.03355540335178375,0.023353222757577896,0.027102727442979813,0.008923940360546112,0.04196964204311371,0.10648612678050995,-0.01744609698653221,0.0019266846356913447,-0.04089239239692688,0.009922600351274014,-0.02765544317662716,-0.01203931588679552,-0.050821978598833084,0.008588070049881935,0.010486271232366562,0.025894107297062874,0.04791936278343201,-0.024667799472808838,-0.00992124155163765,-0.00803361926227808,0.044752370566129684,0.016711989417672157,0.013201702386140823,0.02621462382376194,0.009587633423507214,-0.022157341241836548,-0.008772636763751507,0.01040724292397499,0.004230833612382412,-0.019854040816426277,-0.05337895452976227,0.018900614231824875,0.012507457286119461,-0.0319330058991909,0.01058110874146223,-0.017747901380062103,-0.01473324280232191,-0.02729983814060688,0.033364370465278625,0.02851911075413227,0.018694497644901276,0.041170090436935425,0.028144676238298416,-0.07330892235040665,-0.03439082205295563,0.04874039068818092,0.03849935531616211,0.01481616124510765,0.01821759343147278,0.04376925528049469,0.01881401054561138,-0.005508360452950001,-0.004167346749454737,-0.0013212383491918445,-0.05223914235830307,-0.03634573146700859,0.018378322944045067,-0.0016303635202348232,0.01748119667172432,-0.01921321079134941,0.03549399599432945,-0.008009825833141804,-0.010965736582875252,-0.02458971180021763,-0.04181395098567009,-0.009720382280647755,-0.0021291307639330626,-0.05341916158795357,0.012093105353415012,-0.013677773997187614,0.07378465682268143,0.00434280838817358,-0.022366447374224663,0.00948258861899376,0.003781229257583618,-0.1555849015712738,-0.0041153645142912865,0.01299531664699316,0.009006157517433167,0.03128419816493988,-0.010516228154301643,-0.06446821987628937,0.013601542450487614,-0.006822902709245682,0.02624053880572319,0.010732783004641533,-0.05096074193716049,0.0010267082834616303,-0.0007933431770652533,0.01767350360751152,-0.009459401480853558,0.010237998329102993,-0.041718993335962296,-0.003640588838607073,-0.05284066125750542,-0.02430730126798153,-0.0174898412078619,0.06647244095802307,0.003071338403970003,-0.039079729467630386,-0.012542522512376308,-0.01507965661585331,-0.0016694598598405719,-0.03522174805402756,-0.025427043437957764,-0.041190698742866516,-0.008656288497149944,-0.0063092345371842384,0.023110253736376762,0.006343475077301264,0.05140964686870575,-0.009329622611403465,0.005937517154961824,0.024093065410852432,-0.02117406763136387,0.030527882277965546,-0.02994326502084732,0.019458932802081108,0.022885756567120552,0.03633096069097519,-0.03274504467844963,-0.025193624198436737,0.0304874274879694,-0.05045784264802933,-0.007156927138566971,0.0002632219111546874,-0.03667321428656578,0.03343961760401726,-0.000727548380382359,-0.018832417204976082,0.0076104020699858665,-0.016495658084750175,-0.0035339281894266605,-0.00010041255154646933,0.10188901424407959,-0.05503101274371147,-0.04886370897293091,0.019153127446770668,-0.0003434721438679844,-0.01879286579787731,0.0037846900522708893,-0.010261395014822483,-0.030383341014385223,0.0449259988963604,0.0151467090472579,0.038852814584970474,0.021958941593766212,-0.037593062967061996,-0.016459163278341293,0.0003842625592369586,-0.021652141585946083,-0.015943245962262154,-0.036421410739421844,-0.024624494835734367,-0.11945565044879913,-0.033100925385951996,-0.013826696202158928,0.017142070457339287,-0.013971383683383465,-0.03479816019535065,-0.05463365837931633,-0.0020317421294748783,0.02610885538160801,0.022207291796803474,0.21845991909503937,-0.02780364826321602,0.023863818496465683,-0.011493273079395294,0.08531605452299118,0.012615252286195755,-0.010676571168005466,-0.036802876740694046,-0.014996654354035854,-0.0263341274112463,-0.0040845926851034164,0.011440129019320011,-0.004952683579176664,-0.028654273599386215,-0.0062589398585259914,0.030777733772993088,0.012617946602404118,-0.03648025915026665,0.06575017422437668,0.015085623599588871,0.018838845193386078,0.024512935429811478,-0.0015220518689602613,-0.007385345175862312,0.018611734732985497,-0.028969021514058113,0.00487673282623291,0.03168795257806778,-0.017651529982686043,-0.005381002556532621,-0.017931491136550903,-0.002306448994204402,0.01627206802368164,0.013113864697515965,0.01910778507590294,-0.02273484505712986,-0.010903236456215382,-0.0049823070876300335,0.0011703984346240759,0.03453369066119194,-0.015177121385931969,-0.040049318224191666,0.01880592852830887,0.008752460591495037,0.006948732305318117,0.032821688801050186,0.0027854437939822674,-0.016814159229397774,0.002083203522488475,-0.013623842969536781,0.03191106393933296,-0.021625621244311333,-0.019676540046930313,0.015622952952980995,-0.0051697115413844585,-0.021825358271598816,-0.014015468768775463,-0.03397766873240471,-0.03862281143665314,0.03535090759396553,-0.006396847777068615,0.01572374813258648,-0.06387334316968918,0.03954891487956047,-0.006397388409823179,0.0037548078689724207,0.023829136043787003,9.457120904698968e-05,0.03977523371577263,0.03808773308992386,-0.03438703343272209,0.014624951407313347,0.001777412835508585,-0.028416862711310387,0.007620793767273426,-0.0234756451100111,-0.04015370458364487,0.039268117398023605,0.05067522078752518,-0.025800518691539764,0.0029162170831114054,-0.036653295159339905,0.006617528386414051,-0.0023436537012457848,0.048798732459545135,-0.026369046419858932,0.0008179753785952926,0.015046457760035992,0.019027266651391983,0.015989897772669792,-0.0773497074842453,0.02108943648636341,-0.009692764841020107,-0.01411244086921215,-0.05539141222834587,-0.00019587167480494827,-0.04371081665158272,-0.00780189223587513,-0.06135943904519081,-0.017464954406023026,-0.0301265437155962,-0.028353843837976456,-0.025363223627209663,-0.02946850098669529,0.00931487325578928,-0.012315673753619194,-0.03513934463262558,0.0016309469938278198,-0.01579628325998783,-0.004110914655029774,0.0027306871488690376,0.03724566474556923,0.002088683657348156,-0.02753308042883873,-0.014915152452886105,0.012392194010317326,0.03233878314495087,0.014463855884969234,0.04662397876381874,0.02207363024353981,-0.031118452548980713,-0.02729225344955921,-0.0042227343656122684,0.001124575617723167,-0.05390911549329758,-0.008073769509792328,-0.0014239713782444596,0.00010771185043267906,-0.031153246760368347,0.08069302141666412,-0.019543075934052467,-0.03459890931844711,-0.016283633187413216,0.03887354955077171,0.07352855056524277,-0.01916314661502838,0.07098814845085144,-0.0008823427488096058,0.05033054202795029,0.009257132187485695,0.01544534508138895,-0.01632613316178322,-0.0073908427730202675,0.0041620139963924885,0.00028659816598519683,-0.02209390513598919,0.004789973143488169,-0.051337771117687225,0.011900941841304302,0.007190568372607231,-0.028105808421969414,0.0337865874171257,-0.006938908249139786,-0.055526476353406906,0.022452108561992645,0.002936147153377533,0.00015098188305273652,0.02942933514714241,-0.01374303549528122,-0.03190475329756737,0.0023280722089111805,0.004387746565043926,0.017975622788071632,0.042441319674253464,0.0007961687515489757,0.031680405139923096,0.0367724671959877,0.06029003486037254,0.001455040299333632,-0.02433570846915245,-0.010561436414718628,-0.047577131539583206,-0.06454086303710938,0.015613190829753876,0.035283610224723816,0.029546108096837997,-0.023531636223196983,-0.011892357841134071,-0.008414669893682003,0.02767297439277172,0.006754468660801649,-0.007680680602788925,0.06519999355077744,-0.004525003954768181,0.008401394821703434,-0.015983067452907562,0.04275241866707802,-0.015080669894814491,0.01675167866051197,0.007849342189729214,0.02977675572037697,0.09612622857093811,-0.03471335396170616,-0.014554859139025211,-0.020872734487056732,-0.015555774793028831,-0.014786469750106335,0.017185816541314125,-0.05108167603611946,0.0021739527583122253,-0.06985857337713242,0.022304313257336617,-0.00222887028940022,0.011173094622790813,-0.017673956230282784,0.012225472368299961,-0.016644855961203575,0.03229503706097603,0.007167766336351633,0.0033094247337430716,-0.02083534374833107,-0.017056914046406746,-0.04563407227396965,-0.005314118694514036,0.00310131860896945,-0.028124401345849037,0.013000357896089554,0.022255398333072662,-0.04717923328280449,-0.02639474719762802,0.010452956892549992,-0.031058011576533318,0.04243765398859978,-0.009517954662442207,-0.02080993540585041,-0.0005526000750251114,0.023046601563692093,0.012260761111974716,-0.0019523088121786714,0.007185761816799641,0.002181322779506445,0.03151383996009827,-0.04993157088756561,-0.023618897423148155,0.021357083693146706,0.010918384417891502,-0.004538852255791426,0.06100621819496155,-0.0017870509764179587,-0.05889042094349861,0.0027137589640915394,-0.07317900657653809,-0.041735175997018814,0.08429314196109772,-0.05671488493680954,0.06442365795373917,0.0354963056743145,-0.025663673877716064,0.06414318829774857,0.05483851209282875,-0.024175375699996948,0.04028810188174248,0.002226137323305011,-0.008576133288443089,0.011495297774672508,0.0018570836400613189,0.02222803793847561,-0.0062371306121349335,0.021282950416207314,-0.029733702540397644,-0.029702357947826385,0.061734508723020554,0.003357925219461322,0.026944750919938087,-0.032651323825120926,-0.051689714193344116,0.04495692998170853,-0.046758972108364105,0.0014234259724617004,-0.0025414228439331055,-0.0486932210624218,-0.00418674573302269,-0.013157233595848083,0.006386986002326012,0.03507566824555397,0.01690962165594101,-0.021793877705931664,0.018052101135253906,-0.02032056823372841,-0.0027471340727061033,-0.016039947047829628,0.0024960834998637438,-0.04305771365761757,-0.06217969208955765,0.03233333304524422,0.014101964421570301,0.03885553404688835,0.028143204748630524,-0.014434010721743107,-0.011160621419548988,-0.010956748388707638,-0.051842521876096725,-0.0646885558962822,0.028717122972011566,-0.03722773864865303,-0.012082679197192192,-0.023010235279798508,0.0040945434011518955,-0.019186733290553093,0.018434736877679825,-0.012584713287651539,0.019905321300029755,-0.018455762416124344,-0.018555570393800735,-0.045438501983881,0.01525320578366518,0.004327711183577776,-0.09070004522800446,0.028358854353427887,0.045083608478307724,0.03717751428484917,0.024484196677803993,-0.009517953731119633,-0.009431657381355762,0.0007591199828311801,0.017409102991223335,0.06607170403003693,-0.01292390562593937,0.009375844150781631,0.01923065446317196,0.011820650659501553,0.008648121729493141,-0.04057059437036514,0.06847608834505081,-0.020203202962875366,-0.02259386144578457,-0.05245798081159592,0.020434347912669182,-0.04065997153520584,-0.06251334398984909,-0.02322198450565338,0.004597546067088842,-0.031775906682014465,-0.021978188306093216,0.009289751760661602,0.01025489903986454,0.014906561933457851,0.005595193710178137,-0.019608698785305023,0.04747878387570381,0.0006679797661490738,0.04260798543691635,0.013650446198880672,-0.02289482206106186,0.009342600591480732,0.019170006737113,-0.028037922456860542,-0.016723046079277992,0.010602147318422794,-0.0016515008173882961,0.020876746624708176,0.021600842475891113,-0.010055010206997395,-0.02209591120481491,0.051245685666799545,0.01684993878006935,-0.05305066332221031,-0.004865389317274094,0.035080794245004654,0.020746706053614616,-0.04443787783384323,0.009561375714838505,-0.06022968888282776,0.026691311970353127,-0.02212226577103138,0.006741049233824015,0.018080970272421837,-0.0005539057892747223,0.033643968403339386,-0.00415909243747592,0.001371117657981813,0.005385630764067173,-0.015839895233511925,0.015070218592882156,-0.002025729976594448,0.059577375650405884,-0.023244954645633698,-0.020561033859848976,0.02746720053255558,-0.020906876772642136,-0.001754920114763081,0.015423501841723919,0.020282695069909096,-0.03059510514140129,0.009342650882899761,-0.002001990331336856,-0.06397468596696854,-0.016133993864059448,0.039345528930425644,0.02325895056128502,-0.04873299226164818,0.010032864287495613,-0.023813521489501,0.01412157341837883,-0.15013840794563293,0.0206006970256567,-0.030519740656018257,-0.022590965032577515,-0.03461434692144394,0.02087264694273472,-0.033773887902498245,-0.06551176309585571,-0.00900537520647049,0.010553039610385895,-0.027387361973524094,0.01118522696197033,0.03152376413345337,-0.046793147921562195,0.04595666751265526,0.03732357174158096,-0.009744451381266117,-0.005071235354989767,0.005475230515003204,0.040578410029411316,2.0922398107359186e-05,-0.02326490730047226,0.042800888419151306,0.03803618997335434,-0.024454444646835327,-0.05303192138671875,0.0034539808984845877,0.05011993646621704,-0.034634049981832504,-0.03731266036629677,0.008109056390821934,-0.07372862845659256,0.03926841914653778,0.06551004201173782,-0.0016884456854313612,0.011396174319088459,0.03958761319518089,-0.028950288891792297,0.002899997169151902,0.03617142140865326,0.023285118862986565,0.028067653998732567,0.015173045918345451,0.015815529972314835,-0.006588934920728207,-0.041654907166957855,0.023007646203041077,0.014868589118123055,0.007916150614619255,0.02663443610072136,-0.00999829825013876,0.00835407618433237,-0.00020843675883952528,0.05323968827724457,0.020891036838293076,-0.003166407812386751,-0.05414595454931259,-0.006688897032290697,-0.0015168627724051476,0.05566542595624924,0.00024420907720923424,-0.02238735742866993,-0.042112432420253754,-0.06698784232139587,-0.04556874558329582,0.017894426360726357,-0.040310896933078766,0.024108150973916054,0.025999978184700012,-0.012061280198395252,-0.009200457483530045,-0.009663197211921215,-0.03138483688235283,-0.002211964223533869,0.044647179543972015,0.023203222081065178,0.027417588979005814,0.008448517881333828,-0.009476922452449799,-0.026989677920937538,-0.013745793141424656,-0.009974215179681778,-0.006622327025979757,0.038578376173973083,0.020160555839538574,0.032086264342069626,-0.003854320617392659,0.048850324004888535,-0.03679690882563591,0.0057219816371798515,-0.02013472467660904,-0.03279758617281914,-0.005566930398344994,-0.04384991154074669,-0.005179742816835642,0.009159478358924389,-0.03545248135924339,0.0075321621261537075,-0.004065976943820715,-0.01934107206761837,0.020382894203066826,-0.0008584719034843147,-0.0008569291094318032,-0.0007807754445821047,-0.007518603466451168,0.029353540390729904,-0.005292690359055996,0.01426500454545021,0.013820198364555836,-0.002452387008816004,-0.012918669730424881,-0.046238236129283905,0.00434484425932169,0.004476596135646105,-0.05840316414833069,0.029132850468158722,0.00028053982532583177,0.013025021180510521,-0.03464808687567711,0.005014083813875914,-0.0037589529529213905,0.026595911011099815,0.03855610638856888,-0.04750613868236542,-0.00877139251679182,-0.004393431358039379,0.053048375993967056,0.03228847682476044,-0.029813574627041817,-0.007241407409310341,0.04123177006840706,-0.016475485637784004,0.003159452462568879,0.04989185929298401,0.007689014542847872,-0.015696948394179344,-0.006765330210328102,0.04697233438491821,-0.007351558189839125,0.012446551583707333,-0.007458018604665995,-0.006826048716902733,0.023742282763123512,-0.01563541777431965,-0.03223681449890137,0.008433869108557701,-0.044248830527067184,-0.002161342417821288,-0.06325572729110718,-0.01196405477821827,0.022096144035458565,-0.0231863334774971,-0.025602921843528748,0.060683321207761765,-0.05777692422270775,0.05511962249875069,-0.024466678500175476,0.024175086989998817,0.02553471177816391,0.019947540014982224,-0.04073907434940338,-0.028768563643097878,-0.025981882587075233,-0.012215648777782917,-0.01380565483123064,-0.01764128915965557,0.010345992632210255,-0.0008497639209963381,-0.03824533149600029,-0.003192206844687462,-0.016891472041606903,0.011801679618656635,-0.01573183946311474,0.02528231032192707,0.013951204717159271,-0.0830749049782753,0.02304237149655819,0.005945422686636448,0.08387743681669235,0.0021430361084640026,0.015207139775156975,-0.015361592173576355,0.012571867555379868,0.006508325692266226,0.04382672533392906,0.040645040571689606,-0.020613893866539,0.04337363690137863,0.007515987381339073,0.0527033694088459,0.026706496253609657,0.028836559504270554,0.04965084418654442,-0.0281118992716074,0.0543968603014946,0.054192300885915756,-0.023229757323861122,0.0430452786386013,-0.01894526183605194,0.010333853773772717,-0.040242280811071396,0.024844098836183548,-0.020945783704519272,-0.011371318250894547,-0.01287319790571928,-0.01366319041699171,-0.002420879667624831,-0.005416229832917452,-0.0484641008079052,0.007767138537019491,0.009371640160679817,-0.008116692304611206,0.02182227000594139,0.04527978599071503,-0.0007171550532802939,0.0002759904891718179,-0.027400778606534004,0.01034535001963377,-0.029638037085533142,0.04628844931721687,0.01131171640008688,0.011546695604920387,-0.06597190350294113,0.03318529948592186,-0.030854588374495506,-0.015634773299098015,-0.03665293753147125,-0.033912889659404755,0.014279810711741447,-0.031054912135004997,0.021645866334438324,0.014051077887415886,-0.005874996539205313,0.020198483020067215,0.045445170253515244,0.012097031809389591,0.02301936224102974,-0.03352238982915878,0.02399611286818981,-0.04141134396195412,0.038192395120859146,-0.003725903807207942,0.06473561376333237,-0.007683128118515015],"k":600,"num_candidates":800,"_name":"knn_query"}}],"minimum_should_match":1}}],"filter":[{"term":{"platform_sku_trader":true}},{"term":{"platform_rule_trader":true}},{"bool":{"should":[{"bool":{"must_not":{"exists":{"field":"trader_buyer_ids"}}}},{"term":{"trader_buyer_ids":12883}}]}},{"terms":{"status":[2,4,5]}}]}},"functions":[{"filter":{"term":{"label_id_list":156}},"weight":1.14},{"filter":{"term":{"label_id_list":157}},"weight":1.13},{"filter":{"term":{"label_id_list":158}},"weight":1.1},{"filter":{"term":{"label_id_list":159}},"weight":1.1},{"filter":{"term":{"label_id_list":162}},"weight":1.05},{"filter":{"term":{"label_id_list":163}},"weight":1.1},{"filter":{"term":{"label_id_list":164}},"weight":1.13},{"filter":{"term":{"label_id_list":165}},"weight":1.15},{"field_value_factor":{"field":"on_sell_days_boost","missing":1.0}},{"filter":{"term":{"is_video":true}},"weight":1.2}],"score_mode":"max","boost_mode":"multiply"}},"track_scores":true,"collapse":{"field":"goods_id"},"aggs":{"unique_count":{"cardinality":{"field":"goods_id"}}}} + + +2025-06-28 15:07:36,526 - INFO - [REQ: 0 UID: -1] TIMING: QA=113ms, queryEncoding=0ms, userProfile=0ms, ES=20945ms, BgeReranking=1974ms, BizReranking=9ms, Reranking=1987ms, total=23079ms, sku_id_list_filling=23ms +```bash +{"size": 1000, "from": 0, "_source": {"includes": ["name_zh", "is_star", "category_name_zh", "sub_name_zh", "label_id_list", "is_video", "brand_id", "category_id", "sale_category_all", "price_range", "on_sell_days_boost", "brand_name_zh", "supplier_name"]}, "query": {"function_score": {"query": {"bool": {"must": [{"bool": {"should": [{"multi_match": {"query": "新款拉布布6寸搪胶PVC卡头袋6款混装", "fields": ["name_zh^2.0", "goods_keyword_zh^1.0", "category_name_zh^1.0", "sale_category_keyword_zh^1.0", "sub_name_zh^1.0"], "minimum_should_match": "66%", "tie_breaker": 0.3, "_name": "base_query"}}, {"knn": {"field": "embedding_name_zh", "query_vector": [0.04777948185801506, -0.009930620901286602, -0.03340917453169823, -0.010704109445214272, -0.0495409220457077, 0.014086474664509296, 0.0036832967307418585, -0.013905951753258705, -0.00912229623645544, -0.02091393806040287, 0.005698441993445158, 0.01829547993838787, -0.017833806574344635, 0.04031107947230339, 0.031932197511196136, 0.01550996769219637, -0.03871632367372513, -0.0013923225924372673, 0.014080504886806011, -0.02680817060172558, -0.010332519188523293, 0.002413432113826275, -0.03353426605463028, 0.026190491393208504, 0.043260280042886734, 0.033913154155015945, -0.021475736051797867, 0.007874957285821438, -0.032225947827100754, -0.007520684506744146, 0.008848990313708782, 0.039138346910476685, 0.002573886653408408, -0.04758479446172714, -0.008340752683579922, -0.049250971525907516, 0.00864164624363184, 0.035917505621910095, -0.05339735001325607, 0.03549637272953987, -0.00036399468081071973, 0.012647312134504318, 0.05966982990503311, 0.005590304732322693, 0.04215541109442711, -0.009710724465548992, -0.013751043006777763, -0.010458292439579964, -0.01092573907226324, -0.031235473230481148, 0.03520767390727997, -0.02142075076699257, 0.05230945721268654, -0.08563978224992752, 0.005584254860877991, 0.025608506053686142, -0.005313157569617033, -0.05565866827964783, -0.04408181831240654, -0.04115551337599754, -0.03133457154035568, 0.0035521043464541435, 0.010418717749416828, 0.008755940943956375, -0.014455541968345642, 0.0792229026556015, -0.0006479261792264879, 0.026836542412638664, -0.0099220871925354, -0.04345971718430519, -0.03007948026061058, 0.012955267913639545, -0.0005541691207326949, -0.009107008576393127, -0.06151101365685463, 0.002716085407882929, 0.05793072283267975, 0.018348004668951035, -0.010979007929563522, 0.021718094125390053, 0.0311488825827837, 0.01106400229036808, -0.01580420695245266, -0.009378353133797646, 0.018424641340970993, 0.0033540285658091307, -0.05074841156601906, -0.018410172313451767, -0.06399434059858322, 0.008303754962980747, 0.0008616647101007402, 0.01031291764229536, 0.0024627535603940487, -0.02586234174668789, 0.0064286766573786736, 0.055150166153907776, -0.005198394414037466, -0.02913581021130085, 0.02242407575249672, -0.0035910012666136026, -0.0044089690782129765, 0.06864335387945175, 0.040900155901908875, 0.014038962312042713, -0.01387964840978384, -0.048606064170598984, 0.0013360632583498955, -0.0005932460771873593, 0.0003368504985701293, -0.024940822273492813, 0.008088236674666405, 0.04601464793086052, 0.010241185314953327, 0.004739545285701752, 0.03083225153386593, -0.0336325578391552, -0.015431303530931473, -0.04710129648447037, 0.01660567708313465, 0.010237863287329674, 0.025120045989751816, -0.005079660564661026, 0.04518229514360428, -0.028497137129306793, 0.008398430421948433, -0.049911994487047195, -0.026090597733855247, 0.008263975381851196, -0.011193313635885715, 0.005899224430322647, 0.02586648240685463, -0.01744774542748928, -0.05286448821425438, -0.0037355232052505016, -0.020177341997623444, -0.00937901996076107, 0.004217286594212055, -0.024037707597017288, -0.008115537464618683, -0.02264280430972576, -0.0010051490971818566, 0.07857394218444824, -0.019911985844373703, -0.009416090324521065, 0.004931884352117777, -0.022695835679769516, 0.05615118518471718, 0.01858239434659481, 0.026104934513568878, -0.032858431339263916, 0.0020107044838368893, 0.019154125824570656, 0.01621229574084282, 0.03562867268919945, 0.03500063717365265, -0.04617758095264435, 0.01572221703827381, 0.05247366428375244, -0.023827500641345978, 0.04365061968564987, 0.0006273780600167811, 0.03074229694902897, -0.02591243013739586, -0.03805765137076378, -0.015149170532822609, 0.03779711201786995, 0.02580627053976059, 0.030128315091133118, -0.011303736828267574, 0.03516492247581482, 0.026869751513004303, -0.02845270186662674, 0.059881582856178284, 0.003097916953265667, 0.04811083525419235, 0.003229842521250248, 0.054461948573589325, -0.013254344463348389, 0.023268887773156166, -0.07977989315986633, -0.019608188420534134, 0.038743309676647186, 0.021014267578721046, -0.03317583352327347, -0.030563242733478546, 0.012792572379112244, 0.006061076652258635, -0.027493035420775414, 0.014338426291942596, 0.017754076048731804, 0.004996004980057478, -0.029846904799342155, 0.03648756444454193, -0.038578759878873825, 0.02735607512295246, 0.04637077450752258, -0.032901331782341, 0.010212377645075321, -0.009683933109045029, 0.002401115372776985, 0.015017108991742134, 0.004918758757412434, 0.011426692828536034, 0.006396048236638308, -0.048814959824085236, 0.002921796403825283, 0.019042879343032837, 0.015430758707225323, 0.03393460437655449, -0.04169744253158569, -0.017125923186540604, 0.05922950804233551, 0.008733823895454407, -0.019725129008293152, -0.047633539885282516, -0.0011968417093157768, 0.006019105203449726, 0.014745817519724369, -0.020885944366455078, 0.027048124000430107, -0.04038321226835251, 0.035100437700748444, -0.019358128309249878, 0.06470426172018051, -0.018287939950823784, -0.030778348445892334, -0.03218177706003189, 0.0794251337647438, 0.02252604067325592, -0.026251694187521935, 0.003392222337424755, 0.025379657745361328, -0.012761044315993786, -0.03338577225804329, -0.05206181854009628, 0.01462528109550476, -0.034688081592321396, 0.019273769110441208, 0.0273684561252594, 0.018803877755999565, -0.045315977185964584, -0.03252853825688362, 0.0229090116918087, 0.03802607208490372, -0.0030987553764134645, 0.035308338701725006, -0.0042693340219557285, 0.053714025765657425, -0.021115798503160477, -0.03247977793216705, 0.014298364520072937, 0.021359127014875412, -0.05025552585721016, -0.058426227420568466, -0.028225066140294075, -0.008211921900510788, 0.041396282613277435, -0.0175744891166687, -0.03840591385960579, 0.010588625445961952, -0.011450069956481457, 0.04409050568938255, 0.027623001486063004, 0.006111210212111473, 0.03232325240969658, 0.01910562254488468, -0.013157332316040993, 0.014519988559186459, 0.014888674952089787, -0.025160839781165123, -0.0019194727065041661, -0.009782499633729458, -0.007831890136003494, -0.01422909740358591, -0.06268665194511414, 0.036630041897296906, -0.057012889534235, -0.027425779029726982, 0.051897820085287094, 0.00182741426397115, 0.03560733422636986, 0.025675274431705475, -0.012190687470138073, -0.0068927849642932415, 0.03648059442639351, -0.018904387950897217, -0.04686117172241211, -0.011108235456049442, 0.018694736063480377, -0.012015921995043755, 0.02588983066380024, 0.021791545674204826, 0.0568043552339077, -0.01771237701177597, -0.036844413727521896, 0.03542793542146683, 0.017389442771673203, -0.13236093521118164, 0.005069363862276077, -0.04356488585472107, 0.01762949861586094, 0.0036568883806467056, 0.0357181541621685, -0.04984300583600998, 0.004781763534992933, -0.023634064942598343, -0.006006993819028139, 0.022758550941944122, -0.05710079148411751, 0.025989431887865067, 0.007507902104407549, 0.004580166190862656, -0.027463912963867188, -0.02052846923470497, 0.01266541238874197, 0.0032631719950586557, -0.01589594967663288, -0.019410576671361923, -0.042919766157865524, 0.06982193142175674, -0.01324536558240652, -0.021568164229393005, -0.016236338764429092, 0.023161690682172775, -0.009671044535934925, 0.03011992573738098, -0.04479934275150299, 0.031769800931215286, 0.07410213351249695, 0.004593612626194954, 0.012650864198803902, 0.032900370657444, 0.04676395654678345, -0.005481184460222721, 0.03707682713866234, -0.0343339703977108, 0.014170031994581223, 0.0037862148601561785, 0.005158451851457357, 0.03605901822447777, 0.012319646775722504, 0.02190830372273922, -0.03371215984225273, 0.0013277997495606542, 0.015922417864203453, -0.03311590105295181, -0.02045893669128418, 0.0022150904405862093, 0.024235514923930168, 0.05243319272994995, -0.06884219497442245, -0.032121241092681885, -0.02057197317481041, 0.02464400604367256, 0.023941263556480408, 0.008417989127337933, 0.028591185808181763, -0.03475973382592201, -0.10133542120456696, 0.030981674790382385, -0.0059692696668207645, -0.02728826366364956, 0.018892623484134674, 0.017253372818231583, -0.010950181633234024, 0.010115663520991802, -0.04097826033830643, 0.047668490558862686, 0.005775030702352524, -0.0330018550157547, -0.015302733518183231, -0.026839636266231537, 0.03990592807531357, -0.08095647394657135, -0.010236202739179134, -0.023906735703349113, -0.11363940685987473, -0.02794370800256729, -0.007577626965939999, -0.010191259905695915, -0.031102292239665985, -0.005952379200607538, -0.015238235704600811, 0.021037837490439415, 0.048086635768413544, 0.02485371194779873, 0.2202252894639969, 0.006417000666260719, -0.01582985185086727, -0.020443500950932503, 0.049587927758693695, -0.010321233421564102, -0.019389592111110687, -0.0219429899007082, -0.013874799944460392, -0.021901890635490417, -0.04813386872410774, 0.054123375564813614, 0.0005942619172856212, -0.034767698496580124, -0.008833615109324455, 0.025376304984092712, -0.00027705455431714654, -0.018086474388837814, 0.06567089259624481, 0.02201266773045063, 0.009660826064646244, -0.050511252135038376, -0.009195378981530666, -0.02317940630018711, -0.03656037524342537, -0.030937548726797104, -0.004057656973600388, 0.01446757186204195, -0.0033005152363330126, 0.05119867995381355, -0.0002796838525682688, 0.004812772385776043, -0.01656021922826767, -0.033608417958021164, -0.00369013543240726, -0.04403204470872879, -0.009051754139363766, 0.00161420414224267, -0.006753283087164164, 0.04965002462267876, -0.03266602382063866, -0.031390659511089325, 0.012554764747619629, 0.0403885543346405, -0.008178787305951118, -0.0088236965239048, 0.01938529685139656, 0.022512517869472504, 0.01890033483505249, 0.004583593457937241, -0.018219444900751114, -0.03660663217306137, -0.05960412696003914, 0.018526002764701843, 0.008329992182552814, -0.03104996681213379, -0.0039648874662816525, -0.026751268655061722, -0.006567014381289482, 0.06237832084298134, 0.021959850564599037, 0.008299740962684155, -0.05067161098122597, 0.019776970148086548, -0.03001045435667038, 0.03048914484679699, 0.0013995312619954348, -0.0014632665552198887, -0.008871791884303093, 0.014849912375211716, 0.031150512397289276, 0.044207923114299774, 0.03997069597244263, -0.026292748749256134, 0.06572143733501434, -0.015270156785845757, 0.02528577856719494, 0.024951178580522537, 0.04410326108336449, 0.019941337406635284, -0.04207945242524147, 0.02629714272916317, -0.050845757126808167, 0.006399694364517927, 0.003688838565722108, -0.027066392824053764, 0.03403649106621742, 0.014691866934299469, -0.013028793036937714, -0.02166789583861828, -0.03168860450387001, -0.004749130457639694, -0.03046979196369648, -0.04633525758981705, -0.025907719507813454, -0.020302731543779373, 0.015615634620189667, -0.006162186618894339, -0.02793055586516857, -0.007741870824247599, 0.004227485507726669, -0.03796316310763359, 0.012767232023179531, -0.032471198588609695, -0.023150276392698288, 0.014846229925751686, -0.029468009248375893, -0.031153546646237373, 0.013394993729889393, -0.001276634749956429, 0.037979044020175934, 0.03422647342085838, -6.681141530862078e-05, -0.023563414812088013, -0.007209332659840584, -0.028135180473327637, -0.009307583793997765, 0.0011493850033730268, 0.03275229036808014, -0.0026970740873366594, -0.010681141167879105, -0.006956904660910368, 0.005157421343028545, -0.013205036520957947, -0.012163165956735611, -0.06095128506422043, -0.020321063697338104, -0.0014993196818977594, -0.03912986442446709, 0.030664371326565742, 0.006285347510129213, -0.03537425026297569, 0.0011132827494293451, -0.002627303823828697, -0.02077833004295826, -0.05684716999530792, 0.02123040333390236, 0.004172665998339653, 0.010015258565545082, 0.044045340269804, -0.01734968088567257, -0.05638998746871948, -0.03383277729153633, 0.0023396736942231655, 0.003095283405855298, -0.01121941115707159, -0.007378653157502413, -0.043002281337976456, 0.005443307105451822, 0.059094544500112534, 0.011385264806449413, 0.0419551320374012, 0.042968254536390305, -0.0774039775133133, -0.00788707472383976, -0.02445562370121479, -0.01815369911491871, 0.025737736374139786, -0.027459727600216866, -0.014745943248271942, 0.007133605889976025, -0.016498398035764694, 0.027850404381752014, 0.02756435237824917, -0.011284667067229748, 0.029066434130072594, -0.03676832839846611, 0.03978204354643822, -0.0025798329152166843, -0.020186856389045715, 0.0056440820917487144, -0.03432284668087959, -0.03640623018145561, -0.014417240396142006, 0.04473884031176567, 0.013192025013267994, 0.04739168658852577, -0.034630272537469864, -0.030753694474697113, 0.014856823720037937, 0.02894255891442299, -0.009841032326221466, -0.009405701421201229, 0.005677532404661179, -0.0051913075149059296, 0.01481472048908472, -0.026325812563300133, -0.008713497780263424, 0.012898151762783527, 0.00781390629708767, -0.03967709466814995, 0.05917689576745033, -0.02620290033519268, 0.00016539564239792526, -0.007338281720876694, -0.023503435775637627, -0.008488921448588371, -0.007586051244288683, -0.025655874982476234, -0.03180738165974617, -9.595941082807258e-05, -0.0014381863875314593, 0.03718188405036926, -0.04928509145975113, -0.004411920439451933, -0.003151774639263749, -0.028855348005890846, 0.04923743009567261, 0.013488849624991417, -0.05147544667124748, 0.043314557522535324, -0.014842656441032887, 0.022192806005477905, -0.0020392360165715218, -0.035835329443216324, 0.03502439334988594, 0.009316188283264637, 0.03170185163617134, -0.09451442211866379, -0.003776612924411893, -0.022116290405392647, -0.0037039185408502817, 0.03516470268368721, 0.019655559211969376, 0.020455220714211464, 0.013385603204369545, 0.011516926810145378, -0.059251200407743454, -0.011112687177956104, -0.003960699774324894, 0.0020073282066732645, 0.033514946699142456, -0.017258314415812492, 0.0032192098442465067, -0.0056349909864366055, 0.007177143823355436, 0.012908353470265865, 0.027367528527975082, -0.019316252321004868, -0.006990907248109579, 0.013136813417077065, 0.029212450608611107, -0.016587860882282257, 0.0742068886756897, -0.0253263209015131, 0.056160278618335724, -0.04185504838824272, -0.027046799659729004, 0.08385784924030304, 0.012786808423697948, 0.03263417258858681, 0.00393373379483819, 0.009683518670499325, -0.03565293550491333, 0.0032062623649835587, -0.047266602516174316, -0.019129816442728043, 0.008513612672686577, 0.014801079407334328, -0.006046884693205357, -0.028829116374254227, 0.05553624406456947, -0.045485176146030426, 0.012523164041340351, -0.005150144454091787, -0.07684548199176788, 0.061715416610240936, -0.0598946288228035, 0.005060529336333275, -0.028888961300253868, -0.0338757187128067, -0.003549030050635338, -0.009436641819775105, 0.006171475164592266, 0.04165922850370407, -0.01835727132856846, 0.0071646119467914104, -0.007417601998895407, 0.03760436922311783, 0.022616975009441376, -0.032044071704149246, -0.02622726745903492, 0.030637577176094055, 0.03051326982676983, 0.021725120022892952, -0.04843033477663994, 0.012934836558997631, 0.039799466729164124, 0.008545289747416973, -0.03943444788455963, 0.022497834637761116, 0.007327898871153593, -0.019910702481865883, 0.031814564019441605, -0.007273372728377581, 0.015735039487481117, 0.010907175950706005, 0.03955914080142975, -0.025769470259547234, -0.005889975931495428, 0.0005858503864146769, 0.014834903180599213, -0.03149813413619995, -0.04521970823407173, -0.006687577348202467, -0.026763979345560074, -0.00509474566206336, -0.031613316386938095, -0.0020705198403447866, 0.019639665260910988, 0.008036686107516289, -0.03357526287436485, 0.0050591048784554005, 0.0235908180475235, 0.04358188807964325, -0.012675202451646328, 0.054179996252059937, -0.03303862363100052, 0.01800481230020523, 0.013439487665891647, -0.0331696942448616, -0.006646042224019766, -0.008015387691557407, 0.02479076199233532, 0.01766308583319187, 0.0047085764817893505, -0.011375757865607738, -0.022349664941430092, 0.003323541721329093, -0.03494121879339218, 0.013091305270791054, 0.028886917978525162, -0.005134818144142628, -0.02668473683297634, 0.04115688055753708, 0.030776608735322952, 0.036811713129282, 0.005347450263798237, 0.030731532722711563, -0.018174750730395317, -0.07439709454774857, 0.0007084792596288025, 0.026525957509875298, -0.014472294598817825, 0.01803109236061573, -0.008008803240954876, -0.008096081204712391, 0.0016154551412910223, 0.009521991945803165, -0.008798073045909405, -0.02784651331603527, 0.02028413861989975, -0.030358843505382538, -0.03808901458978653, 0.028802677989006042, 0.004689248278737068, -0.014882923103868961, 0.03565177321434021, 2.2172058379510418e-05, 0.002019741339609027, -0.025061428546905518, 0.015963824465870857, -0.0025464214850217104, -0.011338664218783379, -0.03938833624124527, 0.03270866349339485, 0.013487349264323711, -0.01151502039283514, 0.03501705080270767, -0.029465090483427048, 0.008064762689173222, -0.042369548231363297, -0.024592360481619835, 0.039809320122003555, 0.03941027447581291, -0.0028148856945335865, 0.009110087528824806, 0.0026326305232942104, -0.019704431295394897, 0.026456378400325775, -0.02716045267879963, -0.001671018311753869, 0.004271715879440308, -0.01659168303012848, 0.06367179751396179, 0.0019519432680681348, -0.028779685497283936, -0.00702137965708971, 0.004163833335042, 0.008933528326451778, -0.007324162870645523, 0.007078149821609259, -0.006141898687928915, 0.04244047775864601, -0.13298696279525757, 0.012966402806341648, -0.03154488280415535, -0.03700488805770874, -0.018856942653656006, -0.012444576248526573, -0.005103344563394785, -0.03948184475302696, -0.028914108872413635, -0.0072982837446033955, -0.02986934594810009, -0.028557509183883667, 0.09025005251169205, -0.026758549734950066, -0.006023159250617027, 0.05640563741326332, -0.005632275715470314, -0.01717621274292469, 0.014517580159008503, 0.0454145222902298, 0.011968364007771015, -1.3410058272711467e-05, 0.05054366961121559, 0.0033770177979022264, -0.035783667117357254, -0.0318947471678257, 0.038639068603515625, -0.005597645882517099, -0.04365755617618561, -0.02643357217311859, -0.004100318998098373, -0.05701404809951782, 0.036614082753658295, 0.07144607603549957, 0.00420637521892786, -0.04369935020804405, 0.026639623567461967, -0.03725285455584526, 0.011092692613601685, -0.017785832285881042, 0.014629203826189041, -0.010082025080919266, 0.008299797773361206, 0.013835153542459011, 0.030219702050089836, 0.02464393712580204, 0.032783590257167816, 0.015998510643839836, -0.008723448030650616, 0.020838847383856773, 0.02846018224954605, 0.02805771864950657, -0.021776167675852776, -0.0016920430352911353, 0.06633155792951584, -0.019061263650655746, -0.0328797809779644, -0.028227362781763077, 0.05113675445318222, 0.06641838699579239, -0.05942663550376892, 0.0312500074505806, -0.04965898394584656, -0.07419794797897339, -0.0277184396982193, -0.02882068231701851, -0.024945655837655067, 0.005923386663198471, 0.011076993308961391, 0.027987975627183914, -0.02077493630349636, -0.028385980054736137, -0.030823830515146255, 0.008996518328785896, -0.002466692356392741, -0.0020947083830833435, 0.01321386732161045, -0.011298672296106815, -0.012045539915561676, -0.024114659056067467, 0.002305290661752224, 0.012567861005663872, 0.0001450990530429408, -0.013723531737923622, -0.028525030240416527, -0.024195358157157898, -0.016579115763306618, 0.013486876152455807, -0.05165085941553116, 0.005675381049513817, -0.06880886107683182, -0.012922380119562149, -0.015354347415268421, -0.0025346409529447556, 0.012384090572595596, 0.04576214775443077, -0.001901125768199563, 0.022474762052297592, -0.03674108907580376, 0.0009729872108437121, -0.0008665743516758084, -0.03519943729043007, -0.03061450831592083, 0.051718953996896744, 0.024544652551412582, -0.005045407917350531, -0.003099393332377076, -0.036030903458595276, -0.00561000918969512, 0.017606595531105995, -0.027757544070482254, 0.022533517330884933, -0.0341557078063488, 0.028968194499611855, -0.012559563852846622, -0.013012143783271313, -0.009422944858670235, 0.020035695284605026, -0.034719012677669525, -0.00832070130854845, 0.02455293759703636, -0.00452392315492034, 0.02556878700852394, -0.01182394940406084, -0.03588307648897171, -0.031479790806770325, 0.02734064869582653, -0.01209928747266531, -0.02146436646580696, 0.015257798135280609, 0.03879304602742195, -0.0029163069557398558, -0.013043739832937717, 0.0381423719227314, -0.023813871666789055, 0.0028275649528950453, -0.03091074712574482, 0.05272400751709938, -0.019261367619037628, -0.014952140860259533, -0.011153286322951317, 0.000254094076808542, -0.028622997924685478, -0.023533131927251816, 0.008362245745956898, -0.0020938331726938486, -0.030148902907967567, 0.014103627763688564, -0.08394484221935272, -0.04881484806537628, -0.0023162513971328735, -0.02025669626891613, 0.005037359427660704, 0.026365777477622032, -0.04714160040020943, -0.026581356301903725, 0.011109788902103901, -0.01296536810696125, 0.006858957465738058, 0.048172395676374435, -0.020886855199933052, -0.01881789229810238, -0.019760163500905037, 0.05811499431729317, -0.009254585951566696, 0.05162379890680313, -0.006809046491980553, -0.007441614754498005, -0.05994577705860138, -0.025426752865314484, -0.0033068074844777584, 0.04109293967485428, -0.04208334535360336, 0.018692992627620697, 0.007629444357007742, -0.033140428364276886, -0.02147962525486946, 0.0001421299675712362, 0.06099719926714897, -0.015410018153488636, 0.018314551562070847, 0.02164696529507637, 0.0053083403035998344, 0.03678344935178757, 0.021801859140396118, 0.038568999618291855, -0.037796493619680405, 0.03040582500398159, -0.003390856087207794, 0.04997026175260544, 0.016475005075335503, -0.015403793193399906, 0.028834087774157524, -0.011071411892771721, 0.033636901527643204, -0.0040565612725913525, -0.03536051884293556, 0.027958054095506668, 0.011154691688716412, 0.06971411406993866, -0.025246834382414818, 0.003079240908846259, -0.022101325914263725, -0.01735907606780529, -0.07825532555580139, 0.0024802186526358128, 0.038880981504917145, -0.011109908111393452, 0.03661657124757767, 0.06753414124250412, -0.005024592392146587, 0.0290799792855978, 0.02365652285516262, -0.0006422005826607347, 0.009236408397555351, -0.0036766263656318188, -0.011293289251625538, 0.013936956413090229, 0.013035985641181469, 0.06735581159591675, 0.010661225765943527, 0.023256629705429077, -0.06919150054454803, -0.020434653386473656, -0.01039141695946455, 0.026040272787213326, 0.023702194914221764, -0.014527097344398499, 0.0451965257525444, -0.009080816991627216, -0.021777639165520668, 0.03533657640218735, -0.019043998792767525, 0.042686719447374344, -0.023972440510988235, 0.008945107460021973, 0.0012297232169657946, -0.0024631342384964228, -0.05636504665017128, -0.04025499150156975, 0.006564184091985226, 0.025477567687630653, 0.028906654566526413, 0.03157368674874306], "k": 600, "num_candidates": 800, "_name": "knn_query"}}], "minimum_should_match": 1}}], "filter": [{"bool": {"should": [{"bool": {"must_not": {"exists": {"field": "auth_level_list"}}}}, {"term": {"auth_level_list": "1"}}]}}, {"terms": {"status": [2, 4, 5]}}]}}, "functions": [{"filter": {"term": {"label_id_list": 156}}, "weight": 1.14}, {"filter": {"term": {"label_id_list": 157}}, "weight": 1.13}, {"filter": {"term": {"label_id_list": 158}}, "weight": 1.1}, {"filter": {"term": {"label_id_list": 159}}, "weight": 1.1}, {"filter": {"term": {"label_id_list": 162}}, "weight": 1.05}, {"filter": {"term": {"label_id_list": 163}}, "weight": 1.1}, {"filter": {"term": {"label_id_list": 164}}, "weight": 1.13}, {"filter": {"term": {"label_id_list": 165}}, "weight": 1.15}, {"field_value_factor": {"field": "on_sell_days_boost", "missing": 1.0}}, {"filter": {"term": {"is_video": true}}, "weight": 1.2}], "score_mode": "max", "boost_mode": "multiply"}}, "track_scores": true, "collapse": {"field": "goods_id"}, "aggs": {"unique_count": {"cardinality": {"field": "goods_id"}}}} +``` + +### 1k线上搜索词测试 +自己批量测试的1000条 只有一条超过1S、但是这一条耗时16S +但是这一千条请求,只填充 搜索词、搜索类型、platform几个参数,所以和线上的请求是有些差异的(没有携带各种业务过滤参数和聚合参数) + +2025-06-29 22:25:33,402 - INFO - [REQ: 7277635141262495 UID: 10031] TIMING: QA=81ms, queryEncoding=26ms, userProfile=0ms, ES=15532ms, BgeReranking=101ms, BizReranking=1ms, Reranking=103ms, total=15857ms, sku_id_list_filling=135ms + +{"keyword":"мяч баскетбольный","kt":"kwd","page":1,"size":100,"request_id":7277635141262495,"extra":{"userId":10031,"businessPlatform":"essaone"}} + +{"size":1000,"from":0,"_source":{"includes":["name_zh","is_star","category_name_zh","sub_name_zh","label_id_list","is_video","brand_id","category_id","sale_category_all","price_range","on_sell_days_boost","ru_name"]},"query":{"function_score":{"query":{"bool":{"must":[{"bool":{"should":[{"multi_match":{"query":"мяч баскетбольный","fields":["name_ru^2.0","goods_keyword_ru^1.0","category_name_ru^1.0","sale_category_keyword_ru^1.0","sub_name_ru^1.0"],"minimum_should_match":"66%","tie_breaker":0.3,"_name":"base_query"}},{"knn":{"field":"embedding_name_ru","query_vector":[0.04289894551038742,0.00985910277813673,-0.034268300980329514,0.009927251376211643,-0.02506730891764164,-0.0022724864538758993,0.021023470908403397,0.012512089684605598,-0.007213256787508726,-0.0155626330524683,0.016968950629234314,0.020527228713035583,-0.004494381137192249,0.006936016958206892,0.05834418907761574,-0.043358560651540756,0.021265869960188866,0.00786946713924408,0.02343875914812088,-0.020097509026527405,0.004428471438586712,0.022987786680459976,-0.016837123781442642,0.04001355543732643,0.030128901824355125,-0.020526576787233353,0.0048284707590937614,-0.022848233580589294,-0.017915409058332443,-0.041308656334877014,0.009778021834790707,0.026508575305342674,0.027255931869149208,-0.06618311256170273,-0.04006540775299072,-0.012760354205965996,-0.024845384061336517,-0.027004633098840714,-0.033771444112062454,0.07863473892211914,0.02332051284611225,0.02499188855290413,0.012305475771427155,-0.01007290929555893,0.011017706245183945,-0.003604582278057933,0.04882559925317764,-0.024600690230727196,-0.03751907870173454,-3.09971728711389e-05,-0.04446076974272728,-0.0007124604308046401,0.030276477336883545,-0.012156338430941105,0.02764788269996643,0.011158520355820656,0.008210097439587116,0.003985962830483913,-0.06906936317682266,-0.051149141043424606,-0.02866356074810028,-0.0184809397906065,-0.028303569182753563,0.03160034120082855,0.022804316133260727,0.1030687764286995,0.01340210996568203,0.04044792428612709,-0.0006951108807697892,-0.03142579644918442,-0.030528396368026733,0.020310457795858383,-0.035197384655475616,-0.011375757865607738,-0.0371801033616066,0.03825085982680321,0.027344614267349243,-0.023387355729937553,0.0035810910630971193,-0.0404377281665802,0.028862103819847107,-0.030622778460383415,-0.005130908451974392,0.0004950390430167317,-0.03380196914076805,-2.6819625418283977e-05,-0.014891029335558414,0.017194019630551338,-0.012086699716746807,0.027236061170697212,0.032185476273298264,0.007620120886713266,0.003946945071220398,-0.04464099556207657,-0.016398096457123756,0.0005007923464290798,-0.0005411605816334486,-0.02517220750451088,0.03179505467414856,0.0023020475637167692,0.026991689577698708,0.01480980683118105,-0.04185989126563072,0.005089135374873877,-0.02230026386678219,-0.023846641182899475,0.05685099959373474,0.03465936705470085,0.04211190342903137,0.012890998274087906,0.020012883469462395,0.02514079585671425,-0.014575435779988766,0.01421177014708519,-0.005020988639444113,-0.008809729479253292,-0.03311064466834068,0.02610122039914131,0.026517897844314575,0.017540642991662025,0.03247521445155144,-0.02376544289290905,0.03210864216089249,-0.012699628248810768,-0.016704458743333817,-0.020560186356306076,-0.027206994593143463,-0.007998860441148281,-0.012488827109336853,0.0028613281901925802,-0.005140387453138828,0.013065056875348091,-0.003555877134203911,0.007852277718484402,0.015593836084008217,-0.020180784165859222,0.012655628845095634,0.0064012156799435616,0.003723553381860256,-0.04542943835258484,0.030493926256895065,0.06474622339010239,0.02494131214916706,-0.01618345081806183,0.036915525794029236,-0.015264385379850864,0.05034146457910538,-0.008880356326699257,-0.03250479698181152,-0.0337035246193409,0.01335368026047945,0.0019932782743126154,0.03383878618478775,-0.0009181809145957232,-0.007260815240442753,-0.024388810619711876,-0.00827742274850607,0.018284207209944725,-0.0076889232732355595,0.027997937053442,-0.04451410472393036,0.017110131680965424,0.0067266616970300674,0.022615449503064156,0.001863282872363925,-0.03363585099577904,0.029225816950201988,0.025952380150556564,-0.02188272960484028,-0.022404778748750687,0.014182472601532936,-0.06488898396492004,0.0369846448302269,0.04153203219175339,0.02505381405353546,0.008598348125815392,0.04731282591819763,0.015534567646682262,0.00785487238317728,-0.03959432244300842,-0.014267205260694027,-0.01032619271427393,-0.03399171680212021,-0.013300612568855286,-0.06303181499242783,0.048246119171381,0.00110131676774472,0.015134270302951336,-7.183223351603374e-05,0.002462011529132724,-0.05770685896277428,-0.01607060804963112,0.02726883254945278,-0.03249555826187134,0.04061078280210495,0.0009031521040014923,0.0034274966455996037,-0.025739213451743126,-0.0034957160241901875,-0.02640336938202381,-0.019503125920891762,0.032625310122966766,0.008006369695067406,0.010506460443139076,0.010643737390637398,-0.002503338037058711,0.01156450156122446,-0.04965271055698395,0.0679670125246048,-0.005748685449361801,-0.00778236472979188,0.009481523185968399,0.00871544610708952,-0.02106267213821411,-0.022487947717308998,-0.03128858283162117,-0.016993727535009384,0.013434244319796562,0.0017884609987959266,-0.0024710462894290686,-0.017959944903850555,-0.014335518702864647,0.02691134810447693,0.04465331509709358,0.029495909810066223,-0.02635963261127472,0.035436902195215225,0.10094207525253296,0.004390018992125988,0.0009340281249023974,-0.04524293169379234,0.021418044343590736,-0.05956793203949928,0.0017597863916307688,-0.05903895944356918,0.023769211024045944,0.014180279336869717,-0.008166740648448467,0.02303720824420452,0.010815550573170185,-0.03036920353770256,-0.023754950612783432,0.03811511769890785,0.03625554218888283,-0.020034316927194595,0.032796017825603485,-0.004072101321071386,0.03822813928127289,-0.0031090762931853533,-0.0025291922502219677,0.005204276647418737,-0.0156723503023386,-0.027836056426167488,-0.044359587132930756,0.034850820899009705,-0.008934170007705688,-0.004775969311594963,0.004285341128706932,-0.014048836193978786,-0.0067567178048193455,0.03459908068180084,0.01820729300379753,-0.025760382413864136,0.038231633603572845,0.03333388641476631,-0.05142434313893318,-0.024797087535262108,0.04476439952850342,0.04250452667474747,-0.03723198175430298,-0.028837649151682854,-0.020540906116366386,0.01641450822353363,-0.026654930785298347,-0.008292258717119694,0.044563937932252884,-0.02520473673939705,-0.039976540952920914,0.027995405718684196,0.01803576946258545,0.0010205954313278198,0.020021207630634308,-0.012649457901716232,-0.02098412998020649,0.05638851597905159,0.011408013291656971,-0.027536258101463318,-0.033197518438100815,0.029403110966086388,-0.04456411302089691,-0.014448381029069424,-0.024413950741291046,0.06824693083763123,0.007285042200237513,-0.033849384635686874,0.009168616496026516,-0.012990021146833897,-0.13251660764217377,-0.03280903398990631,-0.014275914989411831,0.020374970510601997,0.00817705038934946,-0.009782730601727962,-0.07158806920051575,-0.011243708431720734,0.002516342792659998,0.06266816705465317,-0.02026326395571232,-0.059042684733867645,0.012037320993840694,0.0031802484299987555,-0.006634697318077087,-0.01198265329003334,-0.02755388244986534,-0.019416136667132378,0.01612813025712967,-0.05008013918995857,-0.03285703435540199,-0.023529058322310448,0.035121552646160126,0.005613523069769144,-0.03597012534737587,0.004668953362852335,0.021609775722026825,-0.012366993352770805,-0.040257230401039124,-0.022291501984000206,-0.06050226464867592,0.049908507615327835,-0.008719722740352154,0.048623498529195786,0.0010433349525555968,0.05249406397342682,0.014562529511749744,-0.01845763809978962,0.02634814940392971,0.017018437385559082,0.022231822833418846,0.0005858801887370646,-0.037503570318222046,0.019017668440937996,0.004650314804166555,-0.002004263922572136,-0.034743182361125946,0.04317222908139229,-0.02504369243979454,-0.01363216433674097,0.0278327614068985,-0.018447358161211014,0.045319415628910065,-0.01395604107528925,-0.009115422144532204,0.011384333483874798,-0.024450641125440598,-0.010400857776403427,-0.020801059901714325,0.0532284714281559,-0.03091302327811718,0.012498337775468826,0.014546402730047703,0.060453787446022034,-0.011982751078903675,0.028568144887685776,-0.04307336360216141,-0.03894389048218727,0.043597202748060226,0.005097685847431421,0.014795859344303608,-0.0128038814291358,0.01343140471726656,-0.021620359271764755,-0.03791474178433418,-0.024414362385869026,-0.010476171039044857,-0.0389404371380806,0.009181478060781956,-0.08720149099826813,-0.06557508558034897,-0.01216561533510685,-0.02261705882847309,0.027464957907795906,0.009873147122561932,-0.03790777176618576,0.03245813772082329,0.006283318158239126,0.04392092302441597,0.18762412667274475,0.0015569078968837857,0.008472210727632046,-0.003119369503110647,0.05156579241156578,0.011710809543728828,-0.018842794001102448,0.02917603589594364,-0.05088569223880768,-0.0287027508020401,-0.003951418213546276,-0.007733418606221676,-0.019249293953180313,-0.023889081552624702,-0.011261733248829842,0.012606333009898663,0.015149480663239956,-0.029680438339710236,0.09333977848291397,-0.00013500450586434454,0.03528391197323799,-0.02519160881638527,-0.014547883532941341,0.014552644453942776,0.02114703506231308,-0.05189337581396103,0.004334751982241869,0.019517457112669945,-0.036815088242292404,0.00011842197272926569,-0.027657296508550644,-0.020344922319054604,0.03771381080150604,-0.0027515485417097807,-0.003933642525225878,-0.03455400466918945,-0.020026030018925667,-0.018802380189299583,-0.02347439154982567,0.02910885214805603,-0.005764256697148085,-0.03580589219927788,-0.019720718264579773,0.03072458691895008,-0.026009108871221542,0.050795771181583405,-0.016409602016210556,-0.047235891222953796,-0.012889576144516468,0.013285423628985882,0.029989730566740036,-0.00787315797060728,0.005495417397469282,0.022965462878346443,0.039564698934555054,-0.0409771129488945,-0.008550125174224377,0.020423047244548798,-0.011985637247562408,0.02098277397453785,0.027929922565817833,0.0025344821624457836,-0.08767720311880112,0.028005370870232582,0.0009481562883593142,0.011713268235325813,0.039828021079301834,-0.019305771216750145,0.04894671216607094,0.040866706520318985,0.022028228268027306,0.016010712832212448,0.023800572380423546,0.003740418003872037,0.00014643646136391908,-0.02804023213684559,-0.011580223217606544,0.021959789097309113,0.010988298803567886,-0.02873842604458332,-0.0015563899651169777,-0.038517072796821594,-0.004493627697229385,0.03620840236544609,-0.006006571464240551,0.016570894047617912,-0.00337125058285892,0.020966172218322754,0.042241454124450684,-0.031139861792325974,-0.05274248123168945,-0.0034346955362707376,-0.028965774923563004,-0.05007054656744003,-0.035811107605695724,0.013463050127029419,-0.010950863361358643,0.03897807002067566,-0.055708568543195724,-0.014721239916980267,0.029290711507201195,-0.021006805822253227,0.0025831153616309166,-0.042123906314373016,-0.00037095314473845065,-0.020786777138710022,0.012342908419668674,-0.009422508999705315,0.009251424111425877,0.003476251382380724,-0.005067756399512291,0.04398060590028763,0.008799305185675621,-0.007124000694602728,0.035534221678972244,0.006025924347341061,-0.00026875341427512467,0.011491668410599232,0.005126778036355972,0.0033774138428270817,-0.04069878160953522,-0.03145385906100273,-0.006302133202552795,-0.02811228670179844,-0.016871342435479164,-0.05399102717638016,-0.027439488098025322,0.04627895727753639,-0.031295616179704666,0.057926613837480545,0.005837196949869394,-0.022443650290369987,-0.03381342068314552,0.027001941576600075,0.05063868314027786,-0.020800843834877014,0.07718729227781296,0.021754147484898567,0.042538195848464966,0.027882715687155724,0.007830724120140076,-0.020669208839535713,0.0020759471226483583,0.025989646092057228,-0.028320474550127983,-0.014761989004909992,0.02385944314301014,-0.056272707879543304,0.030338367447257042,0.03631681576371193,0.03115236945450306,0.001322458265349269,-0.001602170872502029,-0.06074734777212143,0.002262378577142954,-0.002561628818511963,-0.005282154772430658,0.016638249158859253,-0.03494030237197876,-0.030911481007933617,-0.0039108265191316605,0.04560539126396179,-0.007855018600821495,0.037990499287843704,-0.03230845928192139,0.022280914708971977,0.049428973346948624,0.02195615880191326,-0.004151022527366877,-0.05515941604971886,-0.01571415737271309,-0.048389457166194916,-0.04875185340642929,-0.012032483704388142,0.029595505446195602,0.03575676679611206,-0.016226746141910553,0.01148922462016344,-4.673020157497376e-05,0.002419161843135953,0.01062636636197567,-0.004526807926595211,-0.01869310438632965,0.03169547766447067,-0.0039108493365347385,0.027311624959111214,0.013312522321939468,-0.02384008653461933,0.021067989990115166,0.008289112709462643,0.01721593365073204,0.13498540222644806,-0.025301247835159302,-0.016628099605441093,0.002610675757750869,-0.0014455715427175164,-0.0012895830441266298,-0.004241904243826866,-0.021494857966899872,-0.007915129885077477,-0.023129431530833244,-0.06289039552211761,0.0067895399406552315,-0.019609197974205017,0.008477495983242989,-0.02340853586792946,-0.013962173834443092,0.043029122054576874,0.011256991885602474,0.006615206599235535,0.00842709094285965,0.011110953986644745,-0.03900165483355522,-0.02272004447877407,-0.019889919087290764,-0.020560285076498985,0.06560773402452469,0.04035598039627075,-0.014076421968638897,-0.02827203832566738,-0.020347245037555695,0.001084661460481584,0.046784866601228714,-0.03711411729454994,-0.01874317228794098,-0.026953237131237984,0.057653650641441345,-0.05347362905740738,0.00406127842143178,-0.004725798033177853,0.0038419198244810104,0.011449555866420269,-0.04481260105967522,0.026740707457065582,0.005487699527293444,0.015189622528851032,-0.01655558869242668,0.01839543506503105,0.03188752010464668,-0.07560966163873672,0.01762406900525093,0.018275057896971703,-0.0018259439384564757,0.06723477691411972,-0.009778632782399654,0.048699621111154556,0.011191237717866898,-0.023585855960845947,0.06043824926018715,0.033316511660814285,-0.03646458685398102,0.03171839937567711,0.039061401039361954,-0.03299668803811073,0.011758765205740929,0.010716218501329422,0.009823662228882313,0.0055337040685117245,-0.02027781680226326,0.044434238225221634,-0.023417990654706955,0.025252310559153557,-0.01637844741344452,0.026325467973947525,0.012743460945785046,-0.03733571246266365,0.003902609460055828,-0.08160773664712906,-0.0019635192584246397,-0.026534466072916985,-0.02705235593020916,-0.011190318502485752,-0.054863397032022476,-0.022469429299235344,0.011640398763120174,0.03063529171049595,-0.008080911822617054,-0.0083406250923872,0.006630913354456425,0.0009113330743275583,-0.02985531836748123,0.00409055408090353,-0.04290902987122536,-0.0031625544652342796,0.011664650402963161,-0.016200240701436996,0.011208810843527317,0.02941548451781273,0.00859347265213728,-0.04806976392865181,-0.04140814393758774,-0.03160985931754112,-0.06015832722187042,0.0036413148045539856,-0.008150891400873661,-0.01953221671283245,-0.03326787054538727,0.03622032701969147,0.00447751535102725,-0.014975418336689472,-0.020837996155023575,0.00940431747585535,-0.034587785601615906,-0.0346517339348793,-0.031099582090973854,0.028304044157266617,0.031032660976052284,-0.054100193083286285,0.011798872612416744,0.03959617763757706,0.007479812949895859,0.019984576851129532,0.0023249092046171427,0.0017746787052601576,0.06018313020467758,0.0046693491749465466,0.020751764997839928,0.024023782461881638,-0.010837688110768795,-0.025447187945246696,0.04806412383913994,-0.005525335669517517,-0.010020580142736435,0.03294605389237404,0.027606314048171043,-0.03561466559767723,0.01953313499689102,-0.02203267440199852,-0.008873567916452885,-0.03560421243309975,0.0016935168532654643,-0.013018500059843063,0.008578465320169926,-0.03372406214475632,-0.02363605424761772,0.024753427132964134,0.03885240480303764,0.01567702740430832,-0.017730925232172012,0.023637020960450172,0.006857735104858875,0.03580120950937271,0.07028796523809433,-0.04534495621919632,0.0465860590338707,0.0822998434305191,0.014615395106375217,-0.014257163740694523,0.01820719987154007,-0.03359945863485336,-0.0037654018960893154,0.027387084439396858,-0.012686132453382015,-0.03165066987276077,0.025856807827949524,0.013975927606225014,-0.047755271196365356,0.009596090763807297,0.035378195345401764,-0.023031650111079216,-0.052946560084819794,0.03902287408709526,-0.08697628974914551,0.0007650483748875558,-0.02747396193444729,0.039477840065956116,-0.029907599091529846,-0.03874655067920685,0.040488775819540024,-0.002082259627059102,-0.0248007420450449,0.017285620793700218,-0.01977693662047386,-0.033778440207242966,-0.013919990509748459,0.042479753494262695,-0.0031244901474565268,-0.020827699452638626,0.04649842530488968,0.011807293631136417,-0.007776105310767889,0.004212469793856144,0.006400883663445711,-0.021155664697289467,0.013709750957787037,-0.033320777118206024,-0.06184367835521698,0.00829515140503645,0.033842090517282486,0.031176408752799034,-0.03214312344789505,-0.003411807119846344,0.005028052721172571,0.01470850221812725,-0.12694455683231354,0.0018897703848779202,0.01791737787425518,-0.03597062826156616,-0.04750250279903412,0.03563278540968895,-0.056755904108285904,-0.0744595155119896,0.0177844800055027,0.027669426053762436,-0.05378463864326477,-0.01707536168396473,0.0344446562230587,-0.05133352801203728,0.024937760084867477,0.02161405235528946,0.029253298416733742,-0.04146696254611015,-0.022549767047166824,0.03452726826071739,0.029425887390971184,-0.023544203490018845,0.052563101053237915,0.02415809966623783,-0.006997709162533283,-0.036546677350997925,0.0003408585616853088,-0.015558761544525623,-0.04703343287110329,-0.027171388268470764,0.048803865909576416,-0.0120015237480402,0.019953399896621704,0.056174542754888535,0.08862745761871338,0.024920575320720673,0.013407970778644085,-0.042790595442056656,-0.005297323223203421,0.026501381769776344,0.060773059725761414,0.01442534476518631,0.010794523172080517,-0.012532815337181091,0.013845203444361687,-0.013856259174644947,0.03645479679107666,0.000491056649480015,-0.017692672088742256,-0.004449401516467333,0.005704398732632399,0.055144648998975754,0.024484168738126755,0.0009120836621150374,0.02769780158996582,-0.04721996560692787,-0.0437353141605854,-0.03426419943571091,-0.0030353472102433443,0.06532897800207138,0.005175999831408262,0.004642026498913765,-0.010198553092777729,-0.11164741963148117,0.0032722693867981434,-0.0152249401435256,-0.061387427151203156,-0.008149731904268265,0.015415345318615437,0.028577173128724098,0.004164310172200203,-0.03527858853340149,0.004114644601941109,-0.024334382265806198,0.009768039919435978,0.036615774035453796,0.044409748166799545,-0.02218494936823845,-0.013834587298333645,-0.033721648156642914,0.012608193792402744,0.02544715628027916,-0.011161528527736664,0.024172907695174217,0.01728871837258339,-0.034891944378614426,-0.045166727155447006,0.03149036690592766,-0.028676412999629974,-0.025630123913288116,-0.03450291231274605,-0.042594075202941895,-0.004277938045561314,0.004977126140147448,-0.026740560308098793,0.010828261263668537,-0.008786126039922237,0.025455767288804054,0.010332930833101273,-0.029624290764331818,0.025222910568118095,-0.05332495644688606,0.020215490832924843,-0.00725834583863616,-0.014051979407668114,0.025231482461094856,0.02870739810168743,-0.025153715163469315,0.0017486201832070947,0.026120835915207863,-0.01094944030046463,-0.0016203569248318672,-0.004288187250494957,-0.0003944599302485585,-0.04951595887541771,-0.027722930535674095,0.021247882395982742,-0.025441348552703857,-0.029132012277841568,0.02611704356968403,0.03426678851246834,-0.03205306455492973,0.043122775852680206,-0.037530578672885895,0.010123169049620628,0.006026758812367916,0.06166285276412964,0.041947267949581146,-0.028590155765414238,0.005821961909532547,0.03878951445221901,-0.043678734451532364,0.021891968324780464,0.019588861614465714,0.02722681127488613,-0.0072005135007202625,-0.014661637134850025,0.03859248012304306,-0.03036857396364212,-0.025163188576698303,-0.029624272137880325,-0.004484932404011488,-0.02115587703883648,-0.034703899174928665,-0.020665785297751427,0.03465457260608673,-0.032381970435380936,-0.02448100969195366,-0.03633696585893631,-0.0436834841966629,0.023309791460633278,-0.026956286281347275,-0.010952495969831944,0.017641672864556313,-0.0102300513535738,0.003557136282324791,-0.06104337051510811,-0.034807249903678894,-0.005303672980517149,-0.004773163702338934,-0.014427333138883114,-0.0012221967335790396,-0.013541251420974731,0.031239276751875877,0.0007876901072449982,-0.01612892746925354,-0.020762234926223755,-0.012705235742032528,-0.04261665791273117,0.006554049905389547,-0.05181668698787689,-0.0010232614586129785,-0.02920578606426716,0.04016171023249626,0.05727822706103325,-0.0637064278125763,0.042474739253520966,-0.02202245034277439,0.053862642496824265,-0.04091379791498184,-0.00358423194848001,-0.0294108297675848,-0.019521895796060562,0.0008547710021957755,0.05577182397246361,-0.0064692022278904915,-0.039945632219314575,0.03217395022511482,0.008500233292579651,0.0010580146918073297,0.0230677742511034,0.015775218605995178,0.04561731964349747,-0.01410161703824997,0.01426507718861103,0.051053181290626526,-0.015263228677213192,0.06109631061553955,-0.020236019045114517,0.03534768521785736,-0.011433257721364498,0.024448689073324203,-0.002005173359066248,-0.013818801380693913,-0.005125164985656738,-0.011358902789652348,-0.014218742959201336,-0.01632663980126381,-0.0168970488011837,-0.007923102006316185,0.0009882465237751603,0.004870997276157141,-0.0316762775182724,-0.009269092231988907,-0.024636149406433105,-0.03711302578449249,-0.017021233215928078,0.05177905783057213,0.010371671989560127,0.04589727520942688,-0.002231868449598551,0.043219443410634995,-0.06742873787879944,0.012290364131331444,-0.03116980940103531,0.029974913224577904,-0.03351745754480362,0.020384468138217926,0.009360012598335743,-0.026679668575525284,0.03614602982997894,-0.03352091833949089,0.0024363042321056128,0.026183461770415306,-0.00671287951990962,-0.02230038307607174,0.04167525842785835,-0.014078160747885704,-0.01655763015151024,-0.037968363612890244,0.032015733420848846,0.0222366563975811,0.04600703343749046,0.02889135293662548],"k":600,"num_candidates":800,"_name":"knn_query"}}],"minimum_should_match":1}}],"filter":[{"term":{"platform_sku_essaone":true}},{"term":{"platform_rule_essaone":true}},{"terms":{"status":[2,4,5]}}]}},"functions":[{"filter":{"term":{"label_id_list":156}},"weight":1.14},{"filter":{"term":{"label_id_list":157}},"weight":1.13},{"filter":{"term":{"label_id_list":158}},"weight":1.1},{"filter":{"term":{"label_id_list":159}},"weight":1.1},{"filter":{"term":{"label_id_list":162}},"weight":1.05},{"filter":{"term":{"label_id_list":163}},"weight":1.1},{"filter":{"term":{"label_id_list":164}},"weight":1.13},{"filter":{"term":{"label_id_list":165}},"weight":1.15},{"field_value_factor":{"field":"on_sell_days_boost","missing":1.0}},{"filter":{"term":{"is_video":true}},"weight":1.2}],"score_mode":"max","boost_mode":"multiply"}},"track_scores":true,"collapse":{"field":"goods_id"},"aggs":{"unique_count":{"cardinality":{"field":"goods_id"}}}} + + + +2025-06-28 12:00:09,683 - INFO - [REQ: 175108319225300 UID: -1] TIMING: QA=0ms, queryEncoding=0ms, userProfile=0ms, ES=13905ms, BgeReranking=0ms, BizReranking=5ms, Reranking=6ms, total=14649ms, sku_id_list_filling=732ms + +2025-06-28 12:00:34,322 - INFO - [REQ: 175108315581700 UID: -1] TIMING: QA=47ms, queryEncoding=0ms, userProfile=0ms, ES=14587ms, BgeReranking=787ms, BizReranking=1ms, Reranking=789ms, total=16736ms, sku_id_list_filling=1309ms + +2025-06-28 12:23:45,140 - INFO - [REQ: 175108461841000 UID: -1] TIMING: QA=0ms, queryEncoding=0ms, userProfile=0ms, ES=5829ms, BgeReranking=0ms, BizReranking=0ms, Reranking=0ms, total=5832ms + +2025-06-28 15:07:36,848 - INFO - [REQ: 0 UID: -1] TIMING: QA=139ms, queryEncoding=82ms, userProfile=0ms, ES=13312ms, BgeReranking=2098ms, BizReranking=10ms, Reranking=2111ms, total=15793ms, sku_id_list_filling=199ms + +2025-06-28 15:42:52,404 - INFO - [REQ: 17510963864686712 UID: 6712] TIMING: QA=0ms, queryEncoding=0ms, userProfile=1ms, ES=1990ms, BgeReranking=0ms, BizReranking=5ms, Reranking=6ms, total=2090ms, sku_id_list_filling=86ms + + + +----------------------------------------- + +## 参考资料 + +### 1. 商品搜索、工厂搜索的聚合 + +#### 1.1 聚合字段优化 +- 商品搜索的 goodsId聚合、和工厂搜索的 brandId聚合,现在的 collapse 是否是最优方案,是否还能同时得到 inner_hits + +### 2. aggs 方面 + +现在的方案是: + +```json +"aggs": { + "category_stats": { + "terms": { + "field": "sale_category_all", + "size": 100 + } + } +} +``` + +#### 2.1 top_hits聚合 +预期是通过减少聚合的候选数量(只对topN进行聚合)来提升性能,但是测试好像更差。测试样本量也不够,写法也有好多种,因此看有没有专业建议。 + +这种方式试了几个好像差不多: + +```json +"aggs": { + "top_hits_agg": { + "sampler": { + "shard_size": 5000 // 关键优化1:仅对前5000文档聚合 + }, + "aggs": { + // 所有的聚合字段 + } + } +} +``` + +或者对每个聚合字段加 top_hits 配置,不知道为什么很慢: + +```json +"aggs": { + "category_stats": { + "top_hits": { + "size": 2 + } + } +} +``` + +#### 2.2 execution_hint优化 +加 "execution_hint": "map" 属性(全内存操作,适用聚合结果数量很小、内存够用的情况) + +```json +"aggs": { + "tags": { + "terms": { + "field": "status", + "execution_hint": "map" + } + } +} +``` + +### 3. 检索表达式 + +通过function_score设定提权。 + +```json +GET /spu/_search +{ + "aggs": { + "top_hits_agg": { + "sampler": { + "shard_size": 5000 // 关键优化1:仅对前5000文档聚合 + } + } + }, + "collapse": { + "field": "goods_id" + }, + "from": 0, + "size": 1000, + "track_scores": true, + "query": { + "function_score": { + "query": { + "bool": { + "filter": [ + { + "terms": { + "status": ["2", "4", "5"] + } + } + ], + "must": [ + { + "bool": { + "minimum_should_match": 1, + "should": [ + { + "multi_match": { + "fields": ["name_zh^2.0", "goods_keyword_zh", "category_name_zh", "sale_category_keyword_zh", "sub_name_zh"], + "query": "合金滑行 喷漆", + "minimum_should_match": 2, + "tie_breaker": 0.301 + } + }, + { + "knn": { + "field": "embedding_name_zh", + "k": 1000, + "num_candidates": 1000, + "query_vector": [0.1,1.1,0.6] + } + } + ] + } + } + ] + } + }, + "functions": [ + { + "filter": { "term": { "label_id_list": 156 } }, + "weight": 1.1 + }, + { + "field_value_factor": { + "field": "on_sell_days_boost", + "missing": 1 + } + } + ], + "score_mode": "max", + "boost_mode": "multiply" + } + }, + "rescore": { // 关键优化2:仅对前N结果应用函数评分 + "window_size": 2000, + "query": { + "rescore_query": { + "function_score": { + "query": {"match_all": {}}, + "functions": [ + { + "filter": {"term": {"label_id_list": 156}}, + "weight": 1.1 + }, + { + "field_value_factor": { + "field": "on_sell_days_boost", + "missing": 1 + } + } + ], + "score_mode": "max", + "boost_mode": "multiply" + } + } + } + } +} +``` + +#### 可以考虑的优化: +1. 提权只对主检索表达式topN window_size + +### 4. ES索引优化 + +所有的term字段,如果是int类型,改为int,现在是字符串。 + +不过好像请求用int也能匹配到,所以ES本身检测如果是数值,那么也会为int类型建立一个倒排?这样的话,如果指定为int,只是节省了一些内存(不再需要为字符串类型建立倒排) + +### 5. ES配置优化建议 + +针对单机、低QPS、5百万级别doc,性能优化建议。ES配置方面。 + diff --git a/docs/ES/ES_8.18/install.sh b/docs/ES/ES_8.18/install.sh new file mode 100644 index 0000000..2fa7750 --- /dev/null +++ b/docs/ES/ES_8.18/install.sh @@ -0,0 +1,47 @@ + +wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.18.0-x86_64.rpm +# wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-9.0.0-x86_64.rpm + +sudo rpm -ivh elasticsearch-8.18.0-x86_64.rpm + +sudo systemctl daemon-reload +sudo systemctl enable elasticsearch.service +sudo systemctl start elasticsearch.service + + + +好的,下面是你安装 Elasticsearch 8.18.0 时的详细信息和解释: +警告:NOKEY + +这个警告表示你安装的 RPM 包是用一个密钥(d88e42b4)签名的,但是你的系统没有这个密钥。这通常是无害的,前提是你信任这个包的来源。如果想避免这个警告,你可以导入 Elasticsearch 的 GPG 密钥: +bash +sudo rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch +安全自动配置 + +Elasticsearch 已经自动启用了传输层和 HTTP 层的 TLS 加密,并且为内置的超级用户 elastic 生成了一个密码(6T_Oq+1Gd=E_MZt=zn6X)。你需要保管好这个密码,初次登录时会用到。 +节点配置 + +如果这个节点需要加入现有的 Elasticsearch 集群,你可以使用集群中生成的 enrollment token 来配置。运行提供的命令来加入集群: +bash +/usr/share/elasticsearch/bin/elasticsearch-reconfigure-node --enrollment-token +服务配置 + +Elasticsearch 没有在安装后自动启动,你需要运行以下命令来使服务自启动并启动它: +bash +sudo systemctl daemon-reload +sudo systemctl enable elasticsearch.service +sudo systemctl start elasticsearch.service +tmpfiles.d 的警告 + +这个警告是由于某个配置文件中引用了 /var/run/elasticsearch,但是这个目录已经不再推荐使用,应该更新为 /run/elasticsearch。这只是一个配置上的小问题,不会影响 Elasticsearch 的正常工作。 + +下一步: + +如果你希望消除 NOKEY 警告,可以导入 GPG 密钥(可选)。 +使用以下命令启动 Elasticsearch 服务: +bash +sudo systemctl daemon-reload +sudo systemctl enable elasticsearch.service +sudo systemctl start elasticsearch.service +使用生成的 elastic 用户密码进行初次登录。 +如果你有特殊需求,可以根据提示更新 tmpfiles 配置。 diff --git a/docs/ES/ES_9 b/docs/ES/ES_9 new file mode 100644 index 0000000..96fe5ea --- /dev/null +++ b/docs/ES/ES_9 @@ -0,0 +1,372 @@ + +### 目标说明 + +**Ubuntu 单机单节点服务器**上安装 **Elasticsearch 9.3.1(9.x 最新小版本)** 的安装与基础调优文档。 + +- 不依赖 GPU(只用 CPU + bfloat16 向量) +- 使用官方 APT 源安装,自动带上自带的 JDK(满足 9.3 的要求) +- 适用于 Ubuntu 20.04/22.04/24.04 等常见版本 +- 单机单节点模式:`discovery.type: single-node` + +--- + +### 1. 系统与前置检查 + +- 操作系统:`Ubuntu 20.04+`(推荐 22.04 / 24.04) +- 需要 root 或 `sudo` 权限 +- 确保系统时间正确、网络能访问 `artifacts.elastic.co` + +```bash +lsb_release -a # 查看 Ubuntu 版本 +curl -I https://artifacts.elastic.co +``` + +--- + +### 2. 添加 Elasticsearch 9.x 官方 APT 仓库 + +#### 2.1 导入 GPG 公钥 + +```bash +sudo mkdir -p /usr/share/keyrings + +wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch \ + | sudo gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg +``` + +#### 2.2 添加 9.x APT 源 + +```bash +echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/9.x/apt stable main" \ + | sudo tee /etc/apt/sources.list.d/elastic-9.x.list +``` + +#### 2.3 更新包索引 + +```bash +sudo apt-get update +``` + +--- + +### 3. 安装 Elasticsearch 9.3.1 + +默认 `apt install elasticsearch` 会安装当前 9.x 仓库里的最新小版本(例如 9.3.1)。 + +```bash +sudo apt-get install elasticsearch +``` + +安装完成后,可以确认版本: + +```bash +/usr/share/elasticsearch/bin/elasticsearch --version +# 预期显示: 9.3.1 ... +``` + +> 说明: +> - 安装包自带并使用自己的 JDK(目前为 22),不依赖系统的 OpenJDK 17。 +> - 不需要自己配置 `JAVA_HOME`,除非有特殊需求。 + +--- + +### 4. 基础配置(单机单节点) + +编辑 `elasticsearch.yml`(路径 `/etc/elasticsearch/elasticsearch.yml`),调整最基本的选项: + +```bash +sudo vim /etc/elasticsearch/elasticsearch.yml +``` + +常用设置示例(仅示意关键行): + +```yaml +cluster.name: searchengine-cluster +node.name: node-1 + +network.host: 0.0.0.0 +http.port: 9200 + +# 单机开发用(生产集群请改成多节点配置) +discovery.type: single-node + +# 安全相关(按你当前 8.18 的做法决定是否开) +xpack.security.enabled: false +``` + +> 如果后续扩展为多节点集群,需要去掉 `discovery.type: single-node`,并按官方文档配置 `cluster.initial_master_nodes`、`seed_hosts` 等参数。 + +--- + +### 5. 使用 bfloat16 半精度向量的注意事项 + +- **前提:必须是 Elasticsearch 9.3+**。 +- 你的项目中,9.3 集群创建索引时,要使用已修改过的 `mappings/search_products.json`(`dense_vector` 增加 `element_type: "bfloat16"`)。 +- 在这台新机器的 9.3 集群上: + - 创建索引时用 bfloat16 版 mapping; + - 从 MySQL 重新同步数据。 + +这一部分是应用层的事,和 ES 安装本身无冲突,只要确保 **老 8.18 集群继续用原 mapping,新 9.3 集群用新 mapping** 即可。 + +--- + +### 6. 启动与开机自启 + +#### 6.1 手动启动 / 停止 + +```bash +# 启动 +sudo systemctl start elasticsearch + +# 查看状态 +sudo systemctl status elasticsearch + +# 停止 +sudo systemctl stop elasticsearch +``` + +#### 6.2 设置开机自启 + +```bash +sudo systemctl enable elasticsearch +``` + +--- + +### 7. 验证服务是否正常 + +#### 7.1 本机访问 + +```bash +curl http://127.0.0.1:9200 +``` + +预期返回类似: + +```json +{ + "name" : "node-1", + "cluster_name" : "searchengine-cluster", + "cluster_uuid" : "...", + "version" : { + "number" : "9.3.1", + ... + }, + "tagline" : "You Know, for Search" +} +``` + +#### 7.2 远程访问(如有) + +如果你在 `elasticsearch.yml` 里把 `network.host` 配成了 `0.0.0.0`,且机器安全组 / 防火墙允许 9200 端口,被访问方可以: + +```bash +curl http://:9200 +``` + +--- + +### 8. Kibana 9.x 安装与配置(单机) + +> 说明:Kibana 版本必须与 Elasticsearch 大版本一致,这里以 9.3.1 为例,使用同一个 9.x APT 仓库。 + +#### 8.1 安装 Kibana + +前面已经添加了 `elastic-9.x` APT 源,这里直接安装 Kibana: + +```bash +sudo apt-get install kibana +``` + +安装完成后,可通过下面命令查看版本(可选): + +```bash +/usr/share/kibana/bin/kibana --version +``` + +#### 8.2 Kibana 基础配置 + +编辑 `kibana.yml`(默认路径 `/etc/kibana/kibana.yml`),至少确认以下几项: + +```bash +sudo vim /etc/kibana/kibana.yml +``` + +常用示例(单机、关闭安全的开发环境): + +```yaml +server.host: "0.0.0.0" # 允许外部访问,如只本机用可改为 "localhost" +server.port: 5601 + +elasticsearch.hosts: ["http://127.0.0.1:9200"] # 指向本机 ES + +# 如果 ES 开启了 xpack.security,需要在这里配置账号密码 +# elasticsearch.username: "kibana_system" +# elasticsearch.password: "your_password" +``` + +> 生产环境建议: +> - 打开 Elasticsearch 的安全功能(`xpack.security.enabled: true`),用官方向导生成用户和证书; +> - Kibana 使用 `kibana_system` 用户连接 ES,并通过 HTTPS 访问; +> - `server.host` 不要暴露为 0.0.0.0,配合防火墙 / 反向代理限制访问来源。 + +#### 8.3 启动与开机自启 Kibana + +```bash +# 启动 Kibana +sudo systemctl start kibana + +# 查看状态 +sudo systemctl status kibana + +# 设置开机自启 +sudo systemctl enable kibana +``` + +#### 8.4 验证 Kibana 访问 + +浏览器访问: + +```text +http://:5601 +``` + +如果 ES 未启用安全,首次打开一般会直接进入 Kibana 首页; +如果启用了安全机制,将提示登录,使用你在 ES 初始化时创建的账号密码(如 `elastic` 用户)。 + +--- + +### 9. 与现有 SearchEngine 项目集成 + +在这台新机器上跑你的 SearchEngine 项目时: + +- 环境变量或配置里的 ES 地址需要指向这台机器,例如: + - `ES_HOST=http://127.0.0.1:9200` +- 按你项目已有脚本执行索引初始化和数据导入(在 9.3 上推荐使用 bfloat16 版 mapping): + - 创建索引:使用 `mappings/search_products.json`(bfloat16 版本) + - 执行你现有的数据导入脚本:`./scripts/ingest.sh true` 或 `python main.py ingest ...` + +--- + +### 10. 常见问题提示 + +- **端口 9200 无法访问** + - 检查 `systemctl status elasticsearch` 是否正常运行; + - 检查 `network.host` 是否配置为可访问地址; + - 检查防火墙(`ufw`、安全组)是否放行 9200。 +- **版本不是 9.3.1** + - 确认你添加的是 `https://artifacts.elastic.co/packages/9.x/apt`; + - `apt-cache policy elasticsearch` 查看当前仓库里的版本;如有旧版本仓库,需要清理旧的 `elastic-*.list` 文件。 + +--- + +### 11. 性能与系统配置优化(单机节点) + +> 以下为单机节点在物理机 / 大内存云主机上的推荐基础调优,参考了 8.18 版本的线上配置。具体数值请根据机器内存大小和实际压测结果微调。 + +#### 10.1 JVM 堆内存设置 + +编辑 `jvm.options`(或单独的 options 文件),为 ES 分配合适的堆内存,一般建议: + +- 堆内存占物理内存的 1/2 左右,但不要超过 32GB +- 例如 64GB 物理内存的机器: + +```bash +sudo vim /etc/elasticsearch/jvm.options +``` + +示例(根据实际内存调整): + +```text +-Xms32g +-Xmx32g +``` + +修改完成后需要重启 Elasticsearch 生效。 + +#### 10.2 Elasticsearch 内部缓存相关配置 + +在 `/etc/elasticsearch/elasticsearch.yml` 中,根据机器内存和查询特征,控制 fielddata 与 query cache 占比,例如: + +```yaml +# Fielddata Cache(主要用于排序、聚合) +indices.fielddata.cache.size: 40% # 占物理内存的 40% 上限 + +# Query Cache(用于相同过滤条件的命中缓存) +indices.queries.cache.size: 30% # 占堆内存的 30% 上限 +``` + +对于你当前的电商搜索场景,如果聚合比较多(分类 / 规格分面等),可以适当提高 fielddata cache;如果过滤条件组合多而重复率不高,可以适当降低 query cache。 + +#### 10.3 内核参数(sysctl)优化 + +编辑 `/etc/sysctl.conf`,追加如下内容(来自现有 8.18 生产配置,可直接沿用到 Ubuntu): + +```bash +sudo vim /etc/sysctl.conf +``` + +推荐配置示例: + +```text +# tangwang - Elasticsearch 内核参数优化 +# 最大文件句柄数 +fs.file-max = 1000000 + +# 允许的 VMA 数量(映射的虚拟内存区域,用于 mmap 索引文件) +vm.max_map_count = 655360 + +# 脏页写回相关(削峰写入) +vm.dirty_ratio = 10 +vm.dirty_background_ratio = 5 +vm.dirty_writeback_centisecs = 200 +vm.dirty_expire_centisecs = 6000 + +# inode cache 回收权重 +vm.vfs_cache_pressure = 200 + +# 尽可能少用 swap(内存充裕环境建议 0) +vm.swappiness = 0 +``` + +修改后执行: + +```bash +sudo sysctl -p +``` + +#### 10.4 文件句柄与进程数限制(limits.conf) + +编辑 `/etc/security/limits.conf`,为所有用户(特别是运行 ES 的用户)提升文件描述符和进程数上限: + +```bash +sudo vim /etc/security/limits.conf +``` + +示例(参考现有 8.18 配置): + +```text +# tangwang - ES 资源限制调优 +* soft nofile 655350 +* hard nofile 655350 +root soft nofile 655350 +root hard nofile 655350 + +* soft nproc 102400 +* hard nproc 409600 + +# 允许进程锁定内存(配合后续如需 mlockall 等) +* soft memlock unlimited +* hard memlock unlimited +``` + +修改完成后,建议重新登录终端 / 重启服务,使新的 limits 生效。 + +#### 10.5 单机节点模式小结 + +单机单节点模式下,最关键的是: + +- 在 `elasticsearch.yml` 中设置 `discovery.type: single-node`,避免 ES 等待集群选主; +- 为 ES 分配足够的堆和系统资源(JVM 堆 + sysctl + limits); +- 使用 bfloat16 向量字段,减小内存与磁盘占用,有利于在线搜索性能; +- 通过你现有的压测脚本(搜索 QPS / 延迟、批量索引速度)验证上述参数,在此基础上微调即可。 diff --git a/docs/ES/README__ES查询相关.md b/docs/ES/README__ES查询相关.md deleted file mode 100644 index ee7866c..0000000 --- a/docs/ES/README__ES查询相关.md +++ /dev/null @@ -1,701 +0,0 @@ -# Elasticsearch 查询相关 - -## 根据商品ID查询 - -```json -GET /uat_spu/_search -{ - "query": { - "term": { - "_id": "3588136" - } - } -} -``` - -## 查label_id - -```json -GET /uat_spu/_search -{"query":{"bool":{"must":[{"term":{ "platform_sku_essaone": true }},{"term":{"label_id_list":166}}]}}} -``` - -## collapse折叠 - -```json -GET /spu/_search -{ - "_source": ["_id", "name_zh", "goods_id", "*"], - "size": 1000, - "query": { - "match": { - "name_zh": { - "query": "园艺" - } - } - }, - "collapse": { - "field": "goods_id", // 按 goods_id 字段折叠分组 - "inner_hits": { - "_source": ["_id"], - "name": "top_docs", // 自定义内部结果名称 - "size": 3, // 每组取1个文档 - "sort": [{"_score": "desc"}] // 按评分降序排序 - } - }, - "sort": ["_score"] // 确保外层排序兼容折叠功能 -} -``` - -## 在架、某平台商品数 - -```json -GET /uat_spu/_search -{ - "track_total_hits": 100000, - "query": { - "bool": { - "filter": [ - { - "term": { - "platform_sku_essaone": true - } - }, - { - "term": { - "platform_rule_essaone": true - } - }, - { - "terms": { - "goods_copyright": [ - "1", - "2", - "3" - ] - } - } - ] - } - } -} -``` - -## ID查询 - -```json -GET /uat_spu/_search -{ - "query": { - "term": { - "_id": "3302275" - } - } -} -``` - -## 商品名搜索 - -```json -GET /spu/_search -{ - "_source": { - }, - "size": 1000, - "query": { - "match": { - "name_zh": { - "query": "园艺工具四件套", - "boost": 111.0 - } - } - }, - "aggs" :{ - "goods_agg": { - "terms": { - "field": "goods_id", - "size": 100 - }, - "aggs": { - "top_hits": { - "top_hits": { - "size": 1, - "sort": [{"_score": "desc"}] - } - } - } - } - } -} -``` - -## phrase搜索 - -```json -GET /uat_spu/_search -{ - "_source":["id","goods_id","name_zh"], - "query":{ - "multi_match": { - "_name": "base_query", - "fields": [ - "name_zh^2.0", - "goods_keyword_zh^1.0", - "category_name_zh^1.0", - "sale_category_keyword_zh^1.0", - "sub_name_zh^1.0" - ], - "query": "戏水玩具" - } - } -} -``` - -## aggs聚合查询 - -```json -GET /spu/_search -{ - "_source": { - "excludes": [ - "embedding_name_zh", - "embedding_name_ru", "*" - ], - "includes": ["_id", "name_zh"] - }, - "size": 1000, - "query": { - "match": { - "name_zh": { - "query": "园艺" - } - } - }, - "aggs" :{ - "goods_agg": { - "terms": { - "field": "goods_id", - "size": 100 - }, - "aggs": { - "top_hits": { - "top_hits": { - "size": 1, - "sort": [{"_score": "desc"}] - } - } - } - } - } -} -``` - -## 检查某个字段是否有值 -```json -GET /uat_spu/_search -{ - "track_total_hits": true, - "size": 0, // 不返回 hits,只返回总数 - "query": { - "exists": { - "field": "goods_keyword_zh" - } - } -} -``` -如果是nested字段,要这么查: -```json -GET /uat_spu/_search -{ - "track_total_hits": true, - "size": 0, // 只看总数 - "query": { - "nested": { - "path": "embedding_pic_h14", - "query": { - "exists": { - "field": "embedding_pic_h14.vector" // 或 url,只要子文档里任意字段有值 - } - } - } - } -} -``` - -```json -``` - -## 分词测试 - -### ik_smart分词器 - -```json -POST spu/_analyze -{ - "analyzer": "ik_smart", - "text": "14寸第4代-眼珠实身冰雪公仔带手动大推车,搪胶雪宝宝" -} -``` - -### ik_max_word分词器 - -```json -POST spu/_analyze -{ - "analyzer": "ik_max_word", - "text": "14寸第4代-眼珠实身冰雪公仔带手动大推车,搪胶雪宝宝" -} -``` - -### query_ansj分词器 - -```json -POST spu/_analyze -{ - "analyzer": "query_ansj", - "text": "14寸第4代-眼珠实身冰雪公仔带手动大推车,搪胶雪宝宝" -} -``` - -### index_ansj分词器 - -```json -POST spu_test/_analyze -{ - "analyzer": "index_ansj", - "text": "14寸第4代-眼珠实身冰雪公仔带手动大推车,搪胶雪宝宝" -} -``` - -## 查商品名 - -```json -GET /spu/_search -{ - "_source": { - "includes": [ - "name_zh", - "category_name_zh", - "sub_name_zh", - "label_id_list", - "brand_id", - "category_id", - "price_range", - "on_sell_days_boost" - ] - }, - "collapse": { - "field": "goods_id", - "inner_hits": { - "name": "top_hits", - "size": 1, - "_source": false // 避免返回完整_source - } - }, - "from": 0, - "query": { - "function_score": { - "query": { - "bool": { - "minimum_should_match": 1, - "should": [ - { - "multi_match": { - "_name": "base_query", - "fields": [ - "name_zh^2.0", - "goods_keyword_zh^1.0", - "category_name_zh^1.0", - "sale_category_keyword_zh^1.0", - "sub_name_zh^1.0" - ], - "minimum_should_match": "66%", - "query": "网球", - "tie_breaker": 0.301 - } - } - ] - } - } - } - }, - "size": 1000, - "track_scores": true -} -``` - -# 配置相关 - -## 查看索引信息 - -```bash -GET /_cat/indices/spu?v -``` - -```bash -GET /spu/_mapping -``` - -```bash -GET /spu/_settings -``` - -## 设置刷新时间 - -```json -PUT /spu/_settings -{ - "refresh_interval": -1 -} -``` - -```json -PUT /uat_spu/_settings -{ - "refresh_interval": "600s" -} -``` - -## 设置preload - -```json -POST uat_spu/_close -PUT uat_spu/_settings -{ - "index.store.preload": [] -} - -PUT uat_spu/_settings -{ - "index.store.preload": ["vex", "veq"] -} -# ["nvd", "dvd", "tim", "doc", "dim"] - -POST uat_spu/_open - -``` - -## 修改分片数目 -主分片的数目(number_of_shards)只能创建索引的时候修改 - - -## 查看索引的分片数量、大小分布 -```json -GET _cat/indices/uat_spu?v&s=store.size:desc -GET _cat/shards/uat_spu -``` - -## 类别查询:索引中该类别总数 - -```json -GET /spu/_search -{ - "track_total_hits": 10000000, - "query": {"terms": { - "sale_category_all": [37619] - }} -} -``` - -## 类别查询:模拟平台规则 - -除了类别限定,包括: -1. essaone平台展示过滤 -2. 非专属商品 -3. status 2 4 5 -4. goods_copyright 1,2,3 - -```json -GET /spu/_search -{ - "track_total_hits": 10000000, - "aggs": { - "unique_count": { - "cardinality": { - "field": "goods_id" - } - } - }, - "collapse": { - "field": "goods_id" - }, - "query": { - "bool": { - "filter": [ - { - "bool": { - "minimum_should_match": 1, - "should": [ - { - "term": { - "platform_sku_essaone": true - } - }, - { - "bool": { - "must": [ - { - "term": { - "platform_rule_essaone": true - } - }, - { - "bool": { - "must_not": { - "exists": { - "field": "platform_sku_essaone" - } - } - } - } - ] - } - } - ] - } - }, - { - "bool": { - "must_not": { - "exists": { - "field": "buyer_id" - } - } - } - }, - { - "terms": { - "sale_category_all": [37619] - } - }, - { - "terms": { - "status": [2,4,5] - } - }, - { - "terms": { - "goods_copyright": [ - "1", - "2", - "3" - ] - } - } - ] - } - } -} -``` - -## 关键词查询 - -```json -GET /spu/_search -{ - "size": 1000, - "from": 0, - "_source": { - "includes": ["name_zh","goods_keyword_zh","sub_name_zh","category_name_zh","goods_keyword_zh","sale_category_keyword_zh"] - }, - "query": { - "multi_match": { - "query": "遥控车", - "fields": ["name_zh^3.0", "goods_keyword_zh^1.0", "category_name_zh^1.0", "sale_category_keyword_zh^1.0", "sub_name_zh^1.0"], - "minimum_should_match": "64%", - "tie_breaker": 0.3, - "_name": "base_query" - } - }, - "track_scores": true, - "collapse": { - "field": "goods_id" - } -} -``` - -## 慢查询日志 - -```json -PUT /spu,spu_test/_settings -{ - "index.search.slowlog.threshold.query.warn": "1s", - "index.search.slowlog.threshold.query.info": "800ms", - "index.search.slowlog.threshold.query.debug": "600ms", - "index.search.slowlog.threshold.query.trace": "400ms", - "index.search.slowlog.threshold.fetch.warn": "500ms", - "index.search.slowlog.threshold.fetch.info": "400ms", - "index.search.slowlog.threshold.fetch.debug": "200ms", - "index.search.slowlog.threshold.fetch.trace": "100ms" -} -``` - -```bash -GET /spu,spu_test/_settings?include_defaults=true&filter_path=**.slowlog -``` - ---- - -# 一些问题 - -有一个商品,只命中了"玩具"、没有命中"遥控",两个词命中一个词(注意是所有的字段 总共只命中一个词,玩具命中多次,但是没有任何一个字段有"遥控"),minimum_should_match应该没有达到76%吧,76%是按照什么算的?为什么命中了这个查询条件? - -```json -"multi_match": { - "_name": "base_query", - "fields": [ - "name_zh^2.0", - "goods_keyword_zh^1.0", - "category_name_zh^1.0", - "sale_category_keyword_zh^1.0", - "sub_name_zh^1.0" - ], - "minimum_should_match": "76%", - "query": "遥控玩具", - "tie_breaker": 0.3 -} -``` - -tie_breaker 导致 - -```json -GET /spu/_search -{ - "_source": { - "excludes": [ - "embedding_name_zh", - "embedding_name_ru", "*" - ], - "includes": ["_id", "name_zh"] - }, - "size": 1000, - "query": { - "match": { - "name_zh": { - "query": "园艺" - } - } - }, - "aggs" :{ - "goods_agg": { - "terms": { - "field": "goods_id", - "size": 100 - }, - "aggs": { - "top_hits": { - "top_hits": { - "size": 1, - "sort": [{"_score": "desc"}] - } - } - } - } - } -} - - -商品搜索查询模板 -```json -GET /spu/_search -{ - "_source": { - "includes": [ - "name_zh" - ] - }, - "aggs": { - "category_stats": { - "terms": { - "field": "sale_category_one_all", - "size": 100 - } - }, - "spu_attr_stats": { - "terms": { - "field": "attribute_option_list", - "size": 50 - } - }, - "unique_count": { - "cardinality": { - "field": "goods_id" - } - } - }, - "collapse": { - "field": "goods_id" - }, - "from": 0, - "query": { - "function_score": { - "boost_mode": "multiply", - "functions": [ - { - "filter": { - "term": { - "is_video": true - } - }, - "weight": 1.05 - } - ], - "query": { - "bool": { - "filter": [ - { - "terms": { - "status": [2,4,5] - } - } - ], - "must": [ - { - "bool": { - "minimum_should_match": 1, - "should": [ - { - "multi_match": { - "_name": "base_query", - "fields": [ - "name_en^3.0", - "goods_keyword_en^1.0", - "category_name_en^1.3", - "sale_category_keyword_en^1.0", - "sub_name_en^1.0" - ], - "minimum_should_match": "75%", - "operator": "AND", - "query": "changshen flashing toys", - "tie_breaker": 0.9 - } - }, - { - "knn": { - "_name": "knn_query", - "field": "embedding_name_zh", - "k": 40, - "num_candidates": 120, - "query_vector": [...] - } - } - ] - } - } - ] - } - }, - "score_mode": "sum" - } - }, - "size": 1000, - "sort": [ - { - "_score": { - "order": "desc" - } - } - ], - "track_scores": true -} -``` \ No newline at end of file diff --git a/docs/ES/README__分词相关.md b/docs/ES/README__分词相关.md deleted file mode 100644 index 15f79a5..0000000 --- a/docs/ES/README__分词相关.md +++ /dev/null @@ -1,120 +0,0 @@ - - -工厂搜索 依赖于关键词召回、没有做语义召回和精排,加上语义召回和精排则成本过高,所以对分词效果仍然很依赖。badcase: q=锦鸿 无法召回 锦鸿达 -1. 虽然商品搜索已经不强依赖于分词效果,但是工厂搜索仍然对分词效果有很大依赖,所以进行了优化。 -2. 优化内容: - 1) index_ansj + 自定义词典(需要配置自定义词典。 不配置自定义词典的时候,index_ansj分词结果和query_ansj完全一致,配置自定义词典时,index_ansj 将 ) - 2) ansj自定义词典 补充属性词 - - - - - -| Query | IK_Smart 分词结果 | IK_Max_Word 分词结果 | -|---------|---------------------------------------------|--------------------------------------------------| -| 锦鸿达 | 锦, 鸿达 | 锦, 鸿达 | -| 锦鸿 | 锦, 鸿 | 锦, 鸿 | -| 14寸 4代 | 14寸, 4代 | 14, 寸, 4, 代 | -| q=14寸第4代-眼珠实身冰雪公仔带手动大推车,搪胶雪宝宝 | 14寸, 第, 4代, 眼珠, 实, 身, 冰雪, 公, 仔, 带, 手动, 大, 推车, 搪, 胶, 雪, 宝宝 | 14, 寸, 第, 4, 代, 眼珠, 实, 身, 冰雪, 公仔, 带, 手动, 大, 推车, 搪, 胶, 雪, 宝宝 | -| 金毛犬-狗狗系列积木套 | 金毛犬, 狗狗, 系列, 积木, 套 | 金毛犬, 狗狗, 系列, 积木, 套 | - - - -| Query | query_ansj 分词结果 | index_ansj 分词结果 | -|---------|------------------------------------------|--------------------------------------------------| -| 锦鸿达 | 锦, 鸿达 | 锦, 鸿达, 鸿, 达 | -| 锦鸿 | 锦鸿 | 锦鸿, 锦, 鸿 | -| q=14寸第4代-眼珠实身冰雪公仔带手动大推车,搪胶雪宝宝 | 14寸, 第, 4代, 眼珠, 实, 身, 冰雪, 公仔, 带, 手动, 大, 推车, 搪, 胶, 雪, 宝宝 | 14寸, 寸, 第, 4代, 代, 眼珠, 眼, 珠, 实, 身, 冰雪, 冰, 雪, 公仔, 公, 仔, 带, 手动, 手, 动, 大, 推车, 推, 车, 搪, 胶, 雪, 宝宝, 宝 | -| 金毛犬-狗狗系列积木套 | 金毛犬, 狗狗, 系列, 积木, 套 | 金毛犬, 金毛, 金, 毛, 犬, 狗狗, 狗, 系列, 系, 列, 积木, 积, 木, 套 | - - -ansj 插件自定义词典补充属性词后: -| Query | query_ansj 分词结果 | index_ansj 分词结果 | -|---------|------------------------------------------|--------------------------------------------------| -| 锦鸿达 | 锦, 鸿达 | 锦, 鸿达, 鸿, 达 | -| 锦鸿 | 锦鸿 | 锦鸿, 锦, 鸿 | -| q=14寸第4代-眼珠实身冰雪公仔带手动大推车,搪胶雪宝宝 | 14寸, 第, 4代, 眼珠, 实身, 冰雪, 公仔, 带, 手动, 大, 推车, 搪胶, 雪, 宝宝 | 14寸, 寸, 第, 4代, 代, 眼珠, 眼, 珠, 实身, 实, 身, 冰雪, 冰, 雪, 公仔, 公, 仔, 带, 手动, 手, 动, 大, 推车, 推, 车, 搪胶, 搪, 胶, 雪, 宝宝, 宝 | -| 金毛犬-狗狗系列积木套 | 金毛犬, 狗狗, 系列, 积木, 套 | 金毛犬, 金毛, 金, 毛, 犬, 狗狗, 狗, 系列, 系, 列, 积木, 积, 木, 套 | - - - - -## ik分词器的问题: - -```bash -POST spu/_analyze -{ - "analyzer": "ik_smart", - "text": "14寸第4代-眼珠实身冰雪公仔带手动大推车,搪胶雪宝宝" -} - -POST spu/_analyze -{ - "analyzer": "ik_max_word", - "text": "14寸第4代-眼珠实身冰雪公仔带手动大推车,搪胶雪宝宝" -} - -# ik分词器的问题: -# ik_max_word 结果是: 14 寸 第 4 代 -# 期望是能分出多种形式: 14 寸 14寸 第 4 代 4代 -# ik_smart -# 结果是: 14寸 第 4代 -# 因此 14寸 4代 都无法召回原始文档。 -``` - - -## ansj分词器的问题: - -### 1. index_ansj不符合预期 -index模式(type=index_ansj)不符合预期 :type=index_ansj type=query_ansj 结果永远都是一样的。 -https://github.com/NLPchina/elasticsearch-analysis-ansj/issues/235 - -已解决:需要配置自定义词典 - -### 2. 特殊符号分词粘连问题 -特殊符号(减号)会跟后面的词粘连到一起,导致搜索减号后面的词,无法匹配: - -```bash -GET /_cat/ansj?text=狗狗系列-柴犬积木&type=index_ansj -{ -"name": "-柴", -"nature": "nrf", -"offe": 4, -"realName": "-柴", -"synonyms": null -}, - -GET /_cat/ansj?text=狗狗系列-哈士奇犬&type=index_ansj -{ -"name": "-哈士奇", -"nature": "nrf", -"offe": 4, -"realName": "-哈士奇", -"synonyms": null -}, -``` - -这样的话,如果搜索“柴犬”、“哈士奇”,就不能命中上面的句子。 - -暂时解决办法是: -```json - "analyzer": { - "index_ansj": { - "type": "custom", - "char_filter": ["hyphen_to_space"], - "tokenizer": "index_ansj" - }, - "query_ansj": { - "type": "custom", - "char_filter": ["hyphen_to_space"], - "tokenizer": "query_ansj" - } - } -``` - - - - - - - diff --git a/docs/ES/README__性能优化.md b/docs/ES/README__性能优化.md deleted file mode 100644 index 5d7de03..0000000 --- a/docs/ES/README__性能优化.md +++ /dev/null @@ -1,701 +0,0 @@ - - - -# 性能优化TODO - - -1. 主分片个数设置为12 / 16(暂定 16),replaca保持为0 -2. 缩减索引&预加载内存(3年前的不做向量索引,在uat上 水哥已经做了,索引大小已经从120G减少到61G)。 之后设置预加载(UAT上面已经做了): -```json -POST uat_spu/_close -PUT uat_spu/_settings -{ - "index.store.preload": [] -} - -PUT uat_spu/_settings -{ - "index.store.preload": ["vex", "veq"] -} -PUT uat_spu/_settings -{ - "index.store.preload": ["nvd", "dvd", "tim", "doc", "dim"] -} -# ["nvd", "dvd", "tim", "doc", "dim"] - -POST uat_spu/_open -``` -3. 段优化 (在索引稳定后): -POST /spu/_forcemerge?max_num_segments=1 。这将每个分片内的 Lucene 段合并到最少(理想是1个) -4. UAT索引迁出。 - - -# old - -## 当前主要问题 - -### 1. 按goods_id聚合/去重问题(collapse相关) - -当前采用collapse实现,但存在以下问题: - -#### 1.1 加inner_hits的性能问题 - -我暂时放弃了 inner_hits,但是其实对inner_hits功能有较强的需求,是否有替代办法:能满足 按 goods_id 聚合、也能得到聚合下的原始文档ID、同时能满足分页需求。 - -**对应案例:** - -将下面的"商品搜索实际案例"中的: - -```json -"collapse": { - "field": "goods_id" -} -``` - -替换为: - -```json -"collapse": { - "field": "goods_id", - "inner_hits": { - "_source": false, - "name": "top_docs", - "size": 4 - } -} -``` - -可以看到耗时明显增加,耗时 330ms 增加到 3565ms。 - -#### 1.2 分页不准的问题 - -**背景:** ES的分页是基于索引文档的顺序,而不是折collapse叠后的顺序,这可能导致深度分页时的性能问题或结果不一致。 - -这样会带来两个问题: - -##### a) total不准(total是collapse之前的个数) -我现在的方案是,aggs 再补充一项,计算一个按照 goods_id 的去重数,以此作为 total,从而得到准确的分页。 -( 也可以使用 cardinality 。 cardinality 提供的事近似计数。 希望快速估算唯一值数量,应该使用 cardinality ) - -见下面案例中的 aggs 中的 unique_count - -##### b) from不准 -相关资料提示只是“深度分页时”不准,比如结果跟前面的页内内容重复。但是我试了一些请求,还没找到过重复的情况。 - -并且,商品搜索因为有精排,只要请求的内容位于top1000,则会从ES获得top1000的所有结果,所以top1000内的内容不会有分页不准的问题。 - -而对于工厂搜索,我测试了一些请求,也还没有发现分页内内容跟前面的页的内容重复的情况。 - -所以ES内部实现的from已经是collapse之后的 - -### 2. ES配置优化 - -还有哪些要注意的。 - -## 实际案例 - -### 商品搜索实际案例(简化后) - -```json -GET /spu/_search -{ - "_source": { - "includes": [ - "name_zh" - ] - }, - "aggs": { - "unique_count": { - "cardinality": { - "field": "goods_id" - } - }, - "category_stats": { - "terms": { - "field": "sale_category_one_all", - "size": 10 - } - }, - "certification_stats": { - "terms": { - "field": "goods_certification_type_list", - "size": 10 - } - }, - "deliver_day_stats": { - "terms": { - "field": "deliver_day", - "size": 10 - } - }, - "label_stats": { - "terms": { - "field": "label_id_list", - "size": 10 - } - }, - "material_stats": { - "terms": { - "field": "goods_main_material", - "size": 10 - } - }, - "moq_stats": { - "terms": { - "field": "purchase_moq", - "size": 10 - } - }, - "package_lang_stats": { - "terms": { - "field": "goods_package_lang", - "size": 10 - } - }, - "package_type_stats": { - "terms": { - "field": "package_type", - "size": 10 - } - }, - "spu_attr_stats": { - "terms": { - "field": "attribute_option_list", - "size": 10 - } - } - }, - "collapse": { - "field": "goods_id" - }, - "from": 0, - "query": { - "function_score": { - "boost_mode": "multiply", - "functions": [ - { - "filter": { - "term": { - "label_id_list": 156 - } - }, - "weight": 1.1 - }, - { - "filter": { - "term": { - "is_video": true - } - }, - "weight": 1.2 - } - ], - "query": { - "bool": { - "filter": [ - { - "term": { - "platform_sku_essaone": true - } - }, - { - "term": { - "platform_rule_essaone": true - } - }, - { - "bool": { - "should": [ - { - "bool": { - "must_not": { - "exists": { - "field": "auth_level_list" - } - } - } - }, - { - "term": { - "auth_level_list": "1" - } - } - ] - } - }, - { - "terms": { - "status": [2,4,5] - } - }, - { - "terms": { - "goods_copyright": ["1","2","3"] - } - } - ], - "must": [ - { - "bool": { - "minimum_should_match": 1, - "should": [ - { - "multi_match": { - "_name": "base_query", - "fields": [ - "name_zh^2.0", - "goods_keyword_zh^1.0", - "category_name_zh^1.0", - "sale_category_keyword_zh^1.0", - "sub_name_zh^1.0" - ], - "minimum_should_match": "66%", - "query": "合金车", - "tie_breaker": 0.3 - } - } - ] - } - } - ] - } - }, - "score_mode": "max" - } - }, - "size": 1000, - "track_scores": true -} -``` - -### 工厂搜索实际案例(简化后) - -```json -GET /spu/_search -{ - "_source": [ - "id", - "goods_id", - "brand_id", - "name_zh" - ], - "aggs": { - "unique_count": { - "cardinality": { - "field": "brand_id" - } - }, - "category_stats": { - "terms": { - "field": "sale_category_one_all", - "size": 10 - } - }, - "sale_market_stats": { - "terms": { - "field": "supplier_main_market_list", - "size": 10 - } - } - }, - "collapse": { - "field": "brand_id" - }, - "from": 222, - "query": { - "bool": { - "filter": [ - { - "term": { - "platform_sku_essaone": true - } - }, - { - "term": { - "platform_rule_essaone": true - } - }, - { - "bool": { - "should": [ - { - "bool": { - "must_not": { - "exists": { - "field": "auth_level_list" - } - } - } - }, - { - "term": { - "auth_level_list": "1" - } - } - ] - } - }, - { - "terms": { - "status": [2,4,5] - } - }, - { - "terms": { - "goods_copyright": [ - "1", - "2", - "3" - ] - } - } - ], - "must": [ - { - "bool": { - "minimum_should_match": 1, - "should": [ - { - "multi_match": { - "fields": [ - "brand_name_zh^10.0", - "name_zh^2.0", - "supplier_name^8.0" - ], - "minimum_should_match": "66%", - "query": "义乌市童吉拉", - "tie_breaker": 0.3 - } - } ] - } - } - ] - } - }, - "size": 20 -} -``` - - -### ES 索引配置方面,为提升查询性能,是否需要将副本数设置为1。 -但是为了不影响写入性能,在每次全量前,先关闭副本,全量写入完成后再打开副本。 -```json -PUT /spu_test/_settings -{ - "number_of_replicas": 1 -} -``` - - -### 预热 -2025/6/26 今天早上7点多一次查询(q=木质手工艺品玩具) ES查询阶段耗时20多秒,但是第二次查询就只要几百ms,改变query耗时也正常。 - - -目前已经设置慢查询日志: - -PUT /spu,spu_test/_settings -{ - "index.search.slowlog.threshold.query.warn": "10s", - "index.search.slowlog.threshold.query.info": "5s", - "index.search.slowlog.threshold.query.debug": "2s", - "index.search.slowlog.threshold.query.trace": "500ms", - "index.search.slowlog.threshold.fetch.warn": "1s", - "index.search.slowlog.threshold.fetch.info": "800ms", - "index.search.slowlog.threshold.fetch.debug": "500ms", - "index.search.slowlog.threshold.fetch.trace": "200ms" -} - - -PUT /spu,spu_test/_settings -{ - "index.search.slowlog.threshold.query.warn": "1s", - "index.search.slowlog.threshold.query.info": "800ms", - "index.search.slowlog.threshold.query.debug": "600ms", - "index.search.slowlog.threshold.query.trace": "400ms", - "index.search.slowlog.threshold.fetch.warn": "500ms", - "index.search.slowlog.threshold.fetch.info": "400ms", - "index.search.slowlog.threshold.fetch.debug": "200ms", - "index.search.slowlog.threshold.fetch.trace": "100ms" -} - -动态调整日志级别 (无需重启) -通过集群设置 API 临时调整: -PUT /_cluster/settings -{ - "transient": { - "logger.index.search.slowlog": "info" - } -} - -验证配置是否生效 -GET /spu,spu_test/_settings?include_defaults=true&filter_path=**.slowlog - -日志文件 -logs/.log - - - - -## 慢查询记录 - - -### 07/02 早上 7:45~7:47,100个里面又有8个超过1.5S的, 4个超过5S , 2个超过14S - -#### 8888888946992436 -2025-07-02 07:45:32,092 - INFO - [REQ: 8888888946992436 UID: 10639] REQUEST POST structure: {"keyword":"плащ","kt":"kwd","page":1,"size":100,"request_id":8888888946992436,"extra":{"userId":10639,"businessPlatform":"essa"}} - -2025-07-02 07:45:46,981 - INFO - [REQ: 8888888946992436 UID: 10639] qt:kwd total:14.889394521713257ms TIMING: QA=46ms, queryEncoding=0ms, userProfile=1ms, ES=14824ms, BgeReranking=1ms, BizReranking=1ms, Reranking=2ms, total=14889ms, sku_id_list_filling=12ms - -2025-07-02 07:45:46,968 - INFO - [REQ: 8888888946992436 UID: 10639] ES_query_timing # ProductKeywordSearch # 14824.28 # {"size":1000,"from":0,"_source":{"includes":["name_zh","is_star","category_name_zh","sub_name_zh","label_id_list","is_video","brand_id","category_id","sale_category_all","price_range","on_sell_days_boost","ru_name"]},"query":{"function_score":{"query":{"bool":{"must":[{"bool":{"should":[{"multi_match":{"query":"плащ","fields":["name_ru^2.0","goods_keyword_ru^1.0","category_name_ru^1.0","sale_category_keyword_ru^1.0","sub_name_ru^1.0"],"minimum_should_match":"66%","tie_breaker":0.3,"_name":"base_query"}},{"knn":{"field":"embedding_name_ru","query_vector":[-0.035206761211156845,0.020660383626818657,-0.04898383840918541,0.01842888817191124,-0.059921182692050934,-0.013516250066459179,0.003757030935958028,0.014033733867108822,-0.027964092791080475,0.01029364112764597,-0.00787576287984848,0.02625346928834915,-0.01542199682444334,0.026301803067326546,0.052108507603406906,-0.050406284630298615,0.00483988830819726,0.04060962051153183,0.009472930803894997,-0.0005112694925628603,0.004651694558560848,0.0034800730645656586,0.018641093745827675,0.029394179582595825,0.020360751077532768,0.001675301929935813,-0.005129559896886349,-0.000619593309238553,-0.04827551171183586,-0.00630217557772994,0.020039061084389687,0.018405847251415253,0.034706272184848785,-0.08860606700181961,-0.04726770892739296,-0.032688140869140625,-0.018302561715245247,0.011481991037726402,-0.046269889920949936,0.014546985737979412,0.003089814679697156,0.010171250440180302,-0.011071375571191311,-0.01992928236722946,0.021175755187869072,0.01124000083655119,0.0372454971075058,-0.034685004502534866,-0.01343931071460247,0.02121714875102043,-0.023612814024090767,0.03798554837703705,0.06504618376493454,-0.009450038895010948,0.005906036589294672,0.030142072588205338,-0.03246299922466278,-0.030096540227532387,-0.0849074274301529,-0.020739320665597916,-0.03408554196357727,-0.0029811616986989975,-0.023305756971240044,0.027784742414951324,0.04067830741405487,0.109839528799057,-0.0005762992077507079,0.018221285194158554,-0.007281845901161432,-0.04129931703209877,-0.04749192297458649,-0.0005632156971842051,0.0058455271646380424,-0.004661038983613253,-0.05732613801956177,0.007009096443653107,0.05625062435865402,-0.025481490418314934,0.013432115316390991,0.005354376044124365,0.048216819763183594,-0.010861121118068695,0.0279295165091753,0.001105348696000874,-0.015214173123240471,-0.013066167943179607,-0.05451373755931854,0.004907973110675812,-0.041388705372810364,0.011942931450903416,0.025908607989549637,-0.004652232397347689,0.011163195595145226,-0.056879933923482895,-0.029385222122073174,0.005944914650171995,0.010291633196175098,0.009789329022169113,0.04474876821041107,0.009474224410951138,0.019974328577518463,-0.012655979953706264,-0.020499292761087418,-0.015026221051812172,0.031605109572410583,-0.026804130524396896,0.023546280339360237,0.055264607071876526,0.04840846732258797,-0.018858103081583977,0.004723322577774525,-0.01294822245836258,0.0012377514503896236,0.01827247440814972,0.025621123611927032,-0.023270349949598312,-0.014992653392255306,0.01914968341588974,0.015052393078804016,-0.013205647468566895,0.0169048048555851,0.004617445170879364,0.016027752310037613,-0.01378362812101841,-0.012757807970046997,-0.0346602164208889,-0.015302776359021664,-0.028003660961985588,0.0269561018794775,0.0047284201718866825,0.02838684618473053,0.03655833378434181,-0.01723506674170494,-0.005107777193188667,0.00955332349985838,-0.028216000646352768,0.022160036489367485,-0.011552958749234676,0.0027140516322106123,-0.06404043734073639,0.03287180885672569,0.06553228199481964,-0.03408421576023102,-0.01947455108165741,0.01903623901307583,-0.030194343999028206,0.08181223273277283,-0.001817873097024858,-0.013434878550469875,0.01553320698440075,0.008037151768803596,-0.0016663833521306515,0.061162009835243225,0.002955813892185688,0.031158601865172386,-0.015486419200897217,-0.023676788434386253,0.01596381515264511,0.013413977809250355,0.003498759353533387,-0.014206847175955772,0.06292533874511719,-0.005962688941508532,-0.010250173509120941,0.010891546495258808,-0.06812363117933273,0.019118888303637505,0.0033251780550926924,-0.011573049239814281,-0.019931120797991753,0.025516562163829803,-0.030447019264101982,0.02210240252315998,0.0037979227490723133,0.01469342689961195,0.010654212906956673,0.05843355879187584,0.010645532049238682,0.04514821618795395,-0.05915722995996475,-0.03231963887810707,-0.0037186243571341038,-0.015574388206005096,-0.053289689123630524,-0.062142301350831985,0.032532062381505966,-0.004566668067127466,-0.0005688689998351038,0.012460852973163128,-0.0002137328847311437,-0.03864103928208351,-0.053204890340566635,-0.003222765401005745,-0.0375785157084465,0.013661065138876438,0.036554817110300064,-0.005308432504534721,-0.021835779771208763,0.01610834337770939,-0.024434847757220268,0.019568176940083504,0.021495573222637177,0.027674177661538124,0.012535114772617817,-0.030019603669643402,-0.0057942504063248634,-0.028912071138620377,-0.017957061529159546,0.061209600418806076,-0.022746963426470757,0.004394537769258022,0.03157713636755943,-0.007674273569136858,0.0009010087815113366,-0.027206333354115486,-0.012480284087359905,-0.0025779965799301863,0.051328953355550766,0.01902339980006218,0.013034356757998466,-0.006923840846866369,-0.01160359662026167,0.021379830315709114,0.03169575333595276,0.040882863104343414,-0.0033913704100996256,0.01899077370762825,0.08345057815313339,-0.010554501786828041,-0.03491298854351044,-0.057687703520059586,0.04501834139227867,-0.008133002556860447,-0.02618131972849369,-0.029568562284111977,0.002545944880694151,-0.001665174262598157,0.03253322094678879,0.0024745927657932043,-0.006849205121397972,-0.05318983271718025,-0.025619570165872574,0.014735052362084389,0.02763821743428707,-0.007577501703053713,0.0063603585585951805,-0.00365810701623559,0.025731217116117477,0.03233180195093155,-0.022458139806985855,0.024351079016923904,0.011603618040680885,-0.03997845575213432,-0.043126173317432404,0.024063793942332268,0.0016773768002167344,0.04188883677124977,-0.009149405173957348,-0.01712734065949917,-0.001971685793250799,0.007741072215139866,0.030701320618391037,-0.02069244161248207,0.03917993977665901,0.023362010717391968,-0.05359603092074394,-0.07414817065000534,0.04290693253278732,0.025545785203576088,-0.023132413625717163,-0.029064863920211792,-0.018788963556289673,-0.0072210486978292465,-0.021664045751094818,-0.02780369482934475,0.010197662748396397,-0.029631970450282097,-0.06248059496283531,0.056149572134017944,0.03446534276008606,0.012978330254554749,0.020114615559577942,0.014626489952206612,0.0014688351657241583,0.007488865405321121,0.0018029020866379142,-0.026877358555793762,-0.05628906562924385,0.023198025301098824,-0.05422384664416313,-0.018185559660196304,-0.016266608610749245,0.07812158763408661,0.014885681681334972,-0.03208523988723755,0.024400467053055763,-0.023752763867378235,-0.14391297101974487,0.013684358447790146,-0.00910066906362772,-0.003774787997826934,0.002778866793960333,-0.007355159148573875,-0.049925338476896286,0.0068326424807310104,-0.015949470922350883,0.04995362088084221,0.02202575094997883,-0.050666406750679016,-0.017593706026673317,0.005538220517337322,0.010944854468107224,0.00591089203953743,-0.03195786848664284,-0.0350082665681839,0.04533974826335907,-0.04418160021305084,-0.058949049562215805,-0.024030668660998344,0.06094866618514061,0.006638273596763611,-0.011429576203227043,0.028663814067840576,-0.018866879865527153,-0.01470297109335661,-0.07419563084840775,-0.0006075186538510025,-0.01832914724946022,0.055656205862760544,-0.005896612536162138,0.06476810574531555,-0.002154070418328047,0.039329275488853455,0.03643323481082916,0.02897184155881405,0.012239593081176281,-0.013209196738898754,0.01667504385113716,-0.020171934738755226,-0.007978314533829689,0.002015035366639495,0.0060122255235910416,-0.0005796809564344585,-0.022573299705982208,0.010048048570752144,-0.028690429404377937,-0.0049275285564363,0.011733840219676495,-0.027727371081709862,0.00846127886325121,-0.012962596490979195,-0.018655503168702126,-0.004388416651636362,-0.0027830314356833696,0.021990278735756874,-0.010932429693639278,0.055302660912275314,-0.02620832622051239,-0.01626540906727314,0.022029872983694077,0.041417475789785385,-0.018135935068130493,0.023432670161128044,-0.014476905576884747,-0.021904973313212395,0.05106840282678604,-0.009241272695362568,0.008491065353155136,-0.009605452418327332,-0.010890216566622257,-0.020538344979286194,-0.03786062076687813,-0.018376335501670837,0.005948869977146387,-0.022558849304914474,-0.029248986393213272,-0.09795139729976654,0.0022951881401240826,-0.02722097747027874,-0.02994513511657715,0.02718617580831051,0.010087048634886742,-0.03410033509135246,0.006080645136535168,0.04884191229939461,0.022310344502329826,0.23470163345336914,0.05436817556619644,0.015961380675435066,-0.003585796570405364,0.04928544908761978,-0.015531239099800587,-0.03634936735033989,0.013561204075813293,-0.0127008818089962,-0.04123814404010773,0.04028059169650078,-0.022995449602603912,-0.05858377367258072,-0.025912167504429817,0.002051947871223092,0.028178082779049873,-0.024679195135831833,-0.033295053988695145,0.057560041546821594,0.012898346409201622,-0.001159863779321313,-0.05980786308646202,-0.009578239172697067,-0.006334761623293161,0.008928714320063591,-0.023135699331760406,-0.020989403128623962,0.03972852602601051,-0.0281743835657835,-0.0030933714006096125,-0.030967606231570244,-0.023228729143738747,0.04275300353765488,-0.003396248444914818,-0.021202215924859047,-0.036934223026037216,0.002650831826031208,-0.027669982984662056,-0.02926342748105526,0.023184143006801605,-0.03600231930613518,-0.04196419566869736,0.028035933151841164,-0.012389490380883217,-0.025327419862151146,0.004440063610672951,0.02531650848686695,0.006087713409215212,-0.010013606399297714,0.0007868186803534627,0.01828184723854065,-0.04047589749097824,-0.01882169395685196,0.01670665293931961,-0.0018401563866063952,-0.06178411841392517,-0.004959224723279476,-0.009559997357428074,-0.03630327060818672,0.019544923678040504,0.03323837369680405,0.0019047134555876255,-0.055654801428318024,0.0120793916285038,0.024345638230443,0.04413655027747154,0.038333743810653687,-0.03837909549474716,0.036039143800735474,0.03441465646028519,-0.025983402505517006,0.020418977364897728,0.0023564579896628857,-0.03032052516937256,0.008935485035181046,-0.002342129359021783,-0.023637691512703896,0.04967671260237694,0.0023628254421055317,0.017998643219470978,-0.013052172027528286,-0.020086176693439484,-0.021621353924274445,0.01856628805398941,-0.004594834987074137,5.3746927733300254e-05,0.02068163827061653,0.011181456036865711,0.004704579710960388,-0.06800582259893417,-0.025769870728254318,0.031559403985738754,-0.03243835270404816,-0.042171161621809006,-0.033968374133110046,-0.028492704033851624,0.030332721769809723,0.013217239640653133,-0.05065273120999336,0.0012672850862145424,0.01903768628835678,-0.01986546255648136,-0.0302716176956892,-0.046229422092437744,0.012420049868524075,-0.057180698961019516,0.011192794889211655,-0.011805238202214241,-0.009777616709470749,0.027752839028835297,0.009869647212326527,0.022393478080630302,-0.014004047028720379,-0.03816772252321243,0.02939590811729431,-0.022599423304200172,0.06637869030237198,0.0007234956719912589,0.04250507056713104,0.01874270848929882,-0.034795913845300674,-0.03439943492412567,-0.012029746547341347,-0.026585975661873817,-0.02341972105205059,-0.08398526161909103,-0.001064875046722591,0.010337086394429207,-0.027291441336274147,0.04357384517788887,-0.022910315543413162,-0.028094787150621414,-0.058925777673721313,0.03177836537361145,0.06688185781240463,-0.007260899059474468,0.07961610704660416,0.01818729378283024,0.04384874179959297,0.0069672237150371075,-0.03676052391529083,-0.026600651443004608,-0.009718179702758789,0.02413475140929222,0.002316404366865754,0.013218769803643227,0.025685036554932594,-0.0267532616853714,-0.0005175225087441504,0.008881115354597569,0.00849118735641241,0.021110543981194496,0.01012480165809393,-0.04864375665783882,0.026049554347991943,-0.033437345176935196,0.01862046681344509,0.015985814854502678,-0.04058758541941643,-0.034810714423656464,0.002337781013920903,0.023734498769044876,0.01936843805015087,0.024209536612033844,-0.011239565908908844,0.004950506146997213,0.02515280991792679,0.031176459044218063,-0.007186027243733406,-0.06590321660041809,-0.01442632731050253,-0.03848455473780632,-0.05621578171849251,0.021169142797589302,0.0638895109295845,0.014107379131019115,-0.001493399846367538,-0.0025435914285480976,-0.006533127278089523,-0.03929860144853592,0.026615334674715996,-0.04061077907681465,0.018028495833277702,-0.01668223924934864,-0.0038626976311206818,0.026101356372237206,-0.03197198361158371,-0.0065635270439088345,0.0019417291041463614,-0.0024077303241938353,0.009724567644298077,0.12885814905166626,-0.042364951223134995,-0.015280397608876228,0.0021025585010647774,0.005213343538343906,0.028361251577734947,0.008384518325328827,-0.005955472122877836,-0.025096453726291656,-0.020202528685331345,-0.06277716904878616,0.0037493319250643253,-0.011746613308787346,-0.009712602011859417,0.011140778660774231,0.013527371920645237,0.021172339096665382,-0.003329736879095435,-0.005730032920837402,0.015588180162012577,-0.01058022491633892,-0.061124950647354126,-0.027063122019171715,0.011708902195096016,-0.037272900342941284,0.04661867022514343,0.051509588956832886,-0.032604824751615524,-0.01939493976533413,-0.04458850622177124,-0.025845350697636604,0.08357544243335724,-0.03925212100148201,0.02475445531308651,0.001424501882866025,0.036441098898649216,-0.0008853881736285985,-0.0065232799388468266,-0.008607328869402409,0.0036739481147378683,0.013437087647616863,-0.0005483806598931551,0.013671726919710636,-0.010975610464811325,0.0252169668674469,0.004811613820493221,0.03503024950623512,0.008273469284176826,-0.04754671826958656,-0.0032335694413632154,-0.020629990845918655,0.020103249698877335,0.05603678897023201,-0.009146715514361858,0.047989606857299805,-0.02159910649061203,-0.008421017788350582,0.06128425896167755,0.029185334220528603,-0.013512684032320976,0.022962575778365135,0.01999785378575325,-0.030678022652864456,0.012006080709397793,0.02959463745355606,0.033092010766267776,-0.015923049300909042,-0.009248358197510242,-0.002102521015331149,0.0006527969962917268,0.05228109285235405,-0.011770941317081451,0.03377839922904968,0.0016989668365567923,-0.049906544387340546,0.01880759932100773,-0.0570840910077095,-0.004508663900196552,-0.012727982364594936,-0.009242513217031956,-0.003627593396231532,-0.02874729037284851,-0.004071712028235197,0.0028062432538717985,0.011863901279866695,0.013188064098358154,0.004998673684895039,0.02011021599173546,0.0007077555055730045,-0.034099280834198,-0.008439776487648487,-0.041815366595983505,-0.02208874374628067,0.004590209573507309,-0.005805503576993942,0.023512832820415497,0.027854664251208305,0.027635710313916206,-0.030326588079333305,-0.02209583669900894,-0.02466949261724949,-0.03720000013709068,0.04560352489352226,-0.00042570539517328143,-0.02821272797882557,-0.0056007071398198605,0.0023014284670352936,-0.013366803526878357,-0.014828696846961975,-0.02920413762331009,-0.0011925845174118876,-0.048540111631155014,-0.021844858303666115,-0.03979949280619621,0.04372791945934296,0.008035936392843723,-0.057898178696632385,-0.013198129832744598,0.04429883509874344,0.0064583527855575085,0.03409983962774277,0.013824653811752796,0.009123317897319794,0.025508053600788116,0.008969003334641457,0.03677615150809288,0.008993231691420078,-0.02603071555495262,0.030776629224419594,0.012125672772526741,0.0314396433532238,-0.011129194870591164,0.043794889003038406,-2.519373083487153e-05,-0.01874178647994995,0.005505834240466356,-0.018103158101439476,-0.01456343661993742,-0.04242011159658432,-0.00860234722495079,-0.006875118240714073,-0.003689249511808157,-0.035918280482292175,-0.005150370299816132,0.02011486329138279,0.038744986057281494,-0.025435179471969604,-0.033850330859422684,0.04369243234395981,0.010407148860394955,0.0490582212805748,0.044982362538576126,-0.02326131798326969,0.03907119110226631,0.013851706869900227,0.0053246659226715565,0.02681494876742363,-0.021451245993375778,-0.011437231674790382,-0.022223282605409622,0.03694619610905647,0.010058378800749779,-0.020366022363305092,0.027209483087062836,0.020124191418290138,-0.014966033399105072,-0.011139456182718277,0.0030029986519366503,-0.003157819854095578,-0.07452484965324402,0.045879751443862915,-0.07768410444259644,-0.023344967514276505,-0.016970690339803696,0.03432521969079971,-0.00745960371568799,-0.04227651655673981,0.03599528595805168,-0.005419539287686348,-0.007087036035954952,0.0005111709469929338,-0.017311006784439087,-0.03848304599523544,-0.010792597196996212,0.03584851697087288,-0.017352934926748276,-0.009887761436402798,0.030739745125174522,0.0006348391762003303,0.01315715629607439,0.03991811349987984,-4.012811405118555e-05,-0.04894297942519188,0.02184920944273472,-0.002984777092933655,-0.03397710993885994,-0.0006168143008835614,0.0389326773583889,0.019963927567005157,-0.035813018679618835,-0.0035148810129612684,-0.036282654851675034,0.02323351800441742,-0.14055253565311432,-0.0011770421406254172,-0.0007910575368441641,-0.009185176342725754,-0.03751031681895256,0.018624840304255486,-0.018372859805822372,-0.05124770477414131,0.00702853687107563,0.0005150049109943211,-0.05871395766735077,-0.014960653148591518,-0.012675967067480087,-0.058344099670648575,0.051571477204561234,0.04626207798719406,0.017907535657286644,-0.012606747448444366,0.00027081245207227767,0.05110858753323555,0.0063804262317717075,-0.015924256294965744,0.05612455680966377,0.005842928774654865,0.0006801928975619376,-0.026026280596852303,0.0050106649287045,0.007201412692666054,-0.05329363793134689,-0.0049592116847634315,0.021987589076161385,-0.048969246447086334,0.04041697084903717,0.05320906266570091,0.05194704607129097,0.01754378341138363,0.030775057151913643,-0.034510236233472824,0.0018061174778267741,0.01754835620522499,0.005041847005486488,0.022270090878009796,-0.03055517002940178,-0.00565745634958148,0.008246875368058681,0.04205388203263283,0.03508912771940231,-0.02427177131175995,-0.0056594498455524445,-0.0029881615191698074,0.02105557732284069,0.03583899140357971,0.010291791521012783,0.034741733223199844,0.05260966345667839,-0.054904673248529434,-0.020404748618602753,-0.004062421154230833,-0.019812684506177902,0.07352986931800842,-0.005233615171164274,0.002713999478146434,-0.015773078426718712,-0.11096750944852829,-0.025007858872413635,0.013125421479344368,-0.050285711884498596,0.0074223908595740795,0.016822388395667076,0.007340242154896259,-0.0060745421797037125,-0.04604845866560936,0.00123889883980155,-0.03444620966911316,0.00013031024718657136,0.008668433874845505,0.02411758340895176,-0.006479873321950436,-0.027701428160071373,-0.0237407423555851,-0.023862380534410477,0.00860349740833044,0.00012163886276539415,0.01104400772601366,-0.0016930673737078905,-0.0050847833044826984,-0.033998653292655945,0.04723867028951645,-0.039987944066524506,-0.018954621627926826,-0.013241901993751526,-0.028065815567970276,-0.008029542863368988,-0.03646733984351158,0.021735386922955513,0.021358124911785126,-0.0015480235451832414,0.013069476000964642,0.010266493074595928,-0.021802479401230812,0.001115710474550724,-0.022975051775574684,-0.012441503815352917,0.0010741831501945853,-0.037787165492773056,0.04443914443254471,0.04280896112322807,-0.01951548084616661,0.0206343624740839,-0.017379995435476303,-0.012229197658598423,0.0359145924448967,0.009906494989991188,0.03398154303431511,-0.054867222905159,-0.034222718328237534,0.027639850974082947,0.017935309559106827,-0.016600653529167175,0.04243488237261772,-0.011090008541941643,-0.0012337255757302046,0.02144838124513626,-0.04755748063325882,0.028430253267288208,0.03696008399128914,0.036666389554739,0.0034356049727648497,0.00029432112933136523,0.026047931984066963,0.026443278416991234,-0.017619002610445023,0.0034682732075452805,0.019300302490592003,0.03479965403676033,-0.016898181289434433,-0.0025240853428840637,0.05310631915926933,-0.007292068097740412,-0.008197016082704067,-0.010833573527634144,-0.0020867902785539627,0.0006007178453728557,-0.031240833923220634,-0.06258007138967514,-0.01165976095944643,-0.01575843244791031,0.008870338089764118,-0.0609193854033947,-0.03396580368280411,0.03464129939675331,-0.018931003287434578,0.016385870054364204,-0.00834841188043356,0.006441039498895407,0.02742983028292656,-0.02848666161298752,0.01015631202608347,0.02084996923804283,0.02939058467745781,0.0029071224853396416,0.0010421921033412218,-0.01346229575574398,0.010960790328681469,-0.01781773753464222,0.0054703461937606335,-0.00636809878051281,-0.030618872493505478,-0.0607629157602787,0.012134232558310032,-0.03560594469308853,0.014712122268974781,-0.02917938120663166,0.024105576798319817,0.04104112461209297,-0.017275553196668625,0.01021703239530325,-0.031021486967802048,0.07045310735702515,-0.02664598636329174,0.012743153609335423,-0.03889269381761551,-0.002920081838965416,0.015536080114543438,0.036099497228860855,0.02382378838956356,0.0014643787872046232,0.04115711897611618,0.004802360199391842,0.03452477231621742,0.035297833383083344,0.026000341400504112,0.051612429320812225,-0.01692250370979309,0.043301522731781006,0.04238201677799225,-0.013184351846575737,0.019781772047281265,-0.02296600304543972,0.0025291864294558764,0.011808125302195549,0.019398607313632965,-0.048333581537008286,-0.018061719834804535,-0.014784661121666431,-0.025583477690815926,-0.027409924194216728,0.01769193634390831,0.0412142239511013,0.010857541114091873,-0.008557923138141632,-0.00978132989257574,-0.009291511960327625,0.029456451535224915,-0.021604234352707863,-0.04070386663079262,0.016536498442292213,0.021561020985245705,-0.02611173316836357,0.03573843836784363,-0.001385204028338194,0.05891196429729462,-0.056763920933008194,-0.00040730182081460953,-0.039218366146087646,0.006287450436502695,-0.017032165080308914,0.009427487850189209,-0.002574730897322297,-0.005260271020233631,0.036468323320150375,0.02548493631184101,0.0020035214256495237,0.04824838414788246,0.030447717756032944,-0.044185418635606766,0.013747095130383968,-0.015019798651337624,-0.03475117310881615,-0.03381308913230896,0.034938208758831024,0.0029158841352909803,0.01635667309165001,0.0012723793042823672],"k":600,"num_candidates":800,"_name":"knn_query"}}],"minimum_should_match":1}}],"filter":[{"term":{"platform_sku_essa":true}},{"term":{"platform_rule_essa":true}},{"terms":{"status":[2,4,5]}}]}},"functions":[{"filter":{"term":{"label_id_list":156}},"weight":1.14},{"filter":{"term":{"label_id_list":157}},"weight":1.13},{"filter":{"term":{"label_id_list":158}},"weight":1.1},{"filter":{"term":{"label_id_list":159}},"weight":1.1},{"filter":{"term":{"label_id_list":162}},"weight":1.05},{"filter":{"term":{"label_id_list":163}},"weight":1.1},{"filter":{"term":{"label_id_list":164}},"weight":1.13},{"filter":{"term":{"label_id_list":165}},"weight":1.15},{"field_value_factor":{"field":"on_sell_days_boost","missing":1.0}},{"filter":{"term":{"is_video":true}},"weight":1.2}],"score_mode":"max","boost_mode":"multiply"}},"track_scores":true,"collapse":{"field":"goods_id"},"aggs":{"unique_count":{"cardinality":{"field":"goods_id"}}}} - - - -#### 8888886761383165 - -2025-07-02 07:46:00,929 - INFO - [REQ: 8888886761383165 UID: 15852] qt:kwd_factory total:5.89747166633606ms TIMING: QA=73ms, queryEncoding=28ms, userProfile=1ms, ES=190ms, BgeReranking=0ms, BizReranking=0ms, Reranking=0ms, total=5897ms, brand_statistics_query=5631ms - -2025-07-02 07:45:55,032 - INFO - [REQ: 8888886761383165 UID: 15852] REQUEST POST structure: {"keyword":"Double E","kt":"kwd_factory","page":1,"size":100,"request_id":8888886761383165,"extra":{"userId":15852,"businessPlatform":"essaone"}} - -2025-07-02 07:45:55,297 - INFO - [REQ: 8888886761383165 UID: 15852] ES_query_timing # FactoryKeywordSearch # 190.35 # {"query":{"bool":{"must":[{"bool":{"should":[{"multi_match":{"query":"Double E","fields":["brand_name_en^10.0","name_en^2.0","supplier_name^8.0"],"minimum_should_match":"66%","tie_breaker":0.3}},{"term":{"no":{"value":"Double E","boost":15.0}}},{"term":{"hs_no":{"value":"Double E","boost":15.0}}},{"term":{"factory_no":{"value":"Double E","boost":15.0}}},{"term":{"factory_no_buyer":{"value":"Double E","boost":15.0}}},{"term":{"supplier_code":{"value":"Double E","boost":15.0}}},{"match":{"factory_no_fuzzy":{"query":"Double E","boost":5.0}}},{"match":{"factory_no_buyer_fuzzy":{"query":"Double E","boost":5.0}}}],"minimum_should_match":1}}],"filter":[{"term":{"platform_sku_essaone":true}},{"term":{"platform_rule_essaone":true}},{"terms":{"status":[2,4,5]}}]}},"_source":["id","goods_id","brand_id","name_zh","category_name_zh","sub_name_zh","label_id_list","category_id","price_range","on_sell_days_boost","brand_name_zh","supplier_name","is_video"],"from":0,"size":100,"collapse":{"field":"brand_id"},"aggs":{"category_stats":{"terms":{"field":"sale_category_one_all","size":10}},"factory_certification_stats":{"terms":{"field":"supplier_certification_type_list","size":10}},"sale_market_stats":{"terms":{"field":"supplier_main_market_list","size":10}},"factory_category_stats":{"terms":{"field":"supplier_main_category_list","size":10}},"unique_count":{"cardinality":{"field":"brand_id"}}}} - -#### 8888886160313555 -2025-07-02 07:45:52,314 - INFO - [REQ: 8888886160313555 UID: 16341] qt:kwd total:5.246635437011719ms TIMING: QA=54ms, queryEncoding=0ms, userProfile=1ms, ES=5082ms, BgeReranking=3ms, BizReranking=5ms, Reranking=11ms, total=5247ms, sku_id_list_filling=91ms - -2025-07-02 07:45:47,067 - INFO - [REQ: 8888886160313555 UID: 16341] REQUEST POST structure: {"keyword":"домик для игр","kt":"kwd","page":1,"size":100,"request_id":8888886160313555,"extra":{"userId":16341,"businessPlatform":"essa"}} - -2025-07-02 07:45:52,222 - INFO - [REQ: 8888886160313555 UID: 16341] ES_query_timing # ProductKeywordSearch # 5082.04 # {"size":1000,"from":0,"_source":{"includes":["name_zh","is_star","category_name_zh","sub_name_zh","label_id_list","is_video","brand_id","category_id","sale_category_all","price_range","on_sell_days_boost","ru_name"]},"query":{"function_score":{"query":{"bool":{"must":[{"bool":{"should":[{"multi_match":{"query":"домик для игр","fields":["name_ru^2.0","goods_keyword_ru^1.0","category_name_ru^1.0","sale_category_keyword_ru^1.0","sub_name_ru^1.0"],"minimum_should_match":"66%","tie_breaker":0.3,"_name":"base_query"}},{"knn":{"field":"embedding_name_ru","query_vector":[-0.010469888336956501,-0.009433825500309467,-0.061066463589668274,0.015439781360328197,-0.04887380078434944,-0.025594189763069153,0.02132314071059227,0.0048728156834840775,-0.024967197328805923,-0.016300074756145477,0.026881838217377663,0.02839415892958641,-0.04787887632846832,0.008348211646080017,0.02851884812116623,-0.020819339901208878,0.03223418444395065,0.022767407819628716,0.03298615664243698,-0.02291654795408249,0.007127368822693825,0.0026097544468939304,0.03312079608440399,0.030420035123825073,0.0018665859242901206,-0.007431185804307461,0.017863251268863678,-0.001749506569467485,-0.014798518270254135,-0.01667628437280655,0.024006366729736328,-0.0035607542376965284,-0.005410423967987299,-0.051832519471645355,-0.035944465547800064,-0.021218450739979744,-0.010114893317222595,-0.028079111129045486,-0.0533841997385025,0.04635569453239441,-0.0012162572238594294,0.0279274620115757,-0.004270642530173063,-0.033846378326416016,0.029734719544649124,-0.029220541939139366,0.04269053414463997,-0.022250592708587646,-0.051402684301137924,0.00989573448896408,-0.04305187985301018,0.01834198832511902,0.047379374504089355,-0.02046145871281624,0.020443573594093323,0.054781723767519,-0.01415993645787239,-0.03219226747751236,-0.043012600392103195,-0.007893793284893036,-0.01194281131029129,-0.020178208127617836,-0.0457143560051918,0.03828400745987892,0.021164067089557648,0.0818348154425621,0.031024565920233727,0.02610183134675026,-0.023838410153985023,-0.03643917664885521,-0.04240600764751434,-0.013539587147533894,-0.033422503620386124,-0.023028532043099403,-0.03987479954957962,0.037250813096761703,0.020570218563079834,-0.03727980703115463,-0.021551992744207382,0.008813940919935703,0.013401217758655548,-0.03705735504627228,0.03132335841655731,0.013271518982946873,-0.04067348316311836,-0.025765778496861458,-0.018480906262993813,0.0351085290312767,0.01488423254340887,-0.0028665210120379925,0.009210212156176567,-0.0050658416002988815,0.030113283544778824,-0.04046862572431564,-0.026331497356295586,-0.011537943966686726,0.024856189265847206,-0.003682077629491687,0.026156049221754074,0.024270538240671158,0.006325250957161188,-0.009220371022820473,-0.030239824205636978,-0.01933831162750721,0.005819987040013075,-0.02187834493815899,0.005806083790957928,0.03514980152249336,0.005680521950125694,0.0015755404019728303,0.018678558990359306,0.01218269020318985,0.005215473007410765,0.006414385512471199,0.009669029153883457,-0.03394971787929535,-0.01018771342933178,0.012081903405487537,-0.011565321125090122,0.017589492723345757,0.03712606802582741,0.014796657487750053,0.03933378681540489,-0.008113304153084755,0.006041175685822964,0.03321465477347374,-0.019459377974271774,0.0314057394862175,-0.0029240089934319258,0.0013709934428334236,0.028914669528603554,0.06471606343984604,0.007002886850386858,-0.012658798135817051,-0.04317999258637428,-0.01186620444059372,-0.0003211218863725662,0.020922966301441193,-0.003911396488547325,-0.053643420338630676,0.0021015468519181013,0.047227781265974045,-0.00348144443705678,-0.036834292113780975,0.03750087320804596,-0.008714203722774982,0.024695945903658867,-0.003665439784526825,-0.02675502561032772,-0.022107955068349838,-0.011632490903139114,0.020526042208075523,0.02676335908472538,0.03569071739912033,0.017682095989584923,-0.01834474503993988,0.0018101560417562723,0.0283984262496233,0.05491636320948601,0.003809621324762702,0.0006344207795336843,-0.02211061678826809,0.004625074565410614,0.020883994176983833,0.00015821929264348,-0.02832794189453125,0.0008159314747899771,0.0272744819521904,-0.027715962380170822,-0.02472168765962124,-0.016808174550533295,-0.05462613329291344,0.01775122433900833,0.014273782260715961,0.0008496608934365213,0.008177808485925198,0.0421871617436409,0.0045638978481292725,0.042220886796712875,-0.06000344827771187,-0.015377563424408436,0.011407480575144291,-0.03646248206496239,-0.01713411509990692,-0.04549218714237213,0.008391285315155983,0.002547923941165209,0.003514634445309639,-7.575080962851644e-05,0.027596233412623405,-0.03235990181565285,-0.02061750926077366,0.026209574192762375,-0.027568824589252472,0.045371562242507935,0.005951724015176296,-0.00968377199023962,-0.021565992385149002,0.013237068429589272,-0.013479852117598057,-0.0017748709069564939,0.014049606397747993,0.05706736817955971,-0.004590840544551611,-0.004989347420632839,-0.029409339651465416,-0.010748337022960186,-0.034739598631858826,0.046425726264715195,-0.04140014201402664,0.002544855233281851,0.036837805062532425,-0.037906888872385025,0.0013478754553943872,-0.041077353060245514,-0.03370291367173195,-0.018066709861159325,-0.016500622034072876,-0.010342623107135296,0.006782337557524443,-0.007797015365213156,0.011681020259857178,0.03112754039466381,0.04650038108229637,0.03888101875782013,-0.0280715674161911,0.05207274481654167,0.09879706799983978,0.02158382348716259,0.027143163606524467,-0.04732990637421608,-0.0010990563314408064,-0.02125970833003521,-0.059333719313144684,0.003452498698607087,0.009645221754908562,-0.010461045429110527,-0.006256204564124346,0.006562483962625265,-0.012693407014012337,-0.041277870535850525,-0.03793799504637718,0.009225663729012012,0.014676553197205067,-0.029448574408888817,0.019804179668426514,0.0010417350567877293,0.034564901143312454,-0.006257682107388973,-0.026684997603297234,-0.047370005398988724,-0.013308132067322731,-0.026585856452584267,-0.014774832874536514,0.013124870136380196,0.010718361474573612,-0.01895284280180931,-0.006912903394550085,-0.006600252352654934,-0.01494550984352827,0.035866040736436844,0.0033980663865804672,-0.016810467466711998,0.038974154740571976,0.061462365090847015,-0.03711969032883644,-0.04634862393140793,0.007261885795742273,0.04931870102882385,-0.008722336031496525,-0.0410168282687664,0.005162227898836136,0.010419916361570358,-0.04338258504867554,-0.0035620471462607384,-0.029630742967128754,0.0004580442910082638,-0.04241163656115532,0.04071682319045067,0.00014105312584433705,0.016499493271112442,0.015219377353787422,0.03846654295921326,0.008888534270226955,0.011078225448727608,0.034640733152627945,0.02468424290418625,-0.02980225533246994,0.03709685429930687,-0.04838785156607628,-0.022547060623764992,-0.04328358918428421,0.0513724759221077,0.020648853853344917,-0.01620667055249214,-0.0037202714011073112,-0.03920559957623482,-0.14737793803215027,-0.015798239037394524,0.009418384172022343,0.029613904654979706,0.010793381370604038,-0.01496070995926857,-0.06054462119936943,0.02468664012849331,-0.006591952871531248,0.0889967605471611,-0.005320643074810505,-0.05315868929028511,-0.012014172971248627,0.0038997710216790438,-0.003502458333969116,-0.011375060304999352,-0.00010943621600745246,-0.03431030735373497,-0.012095400132238865,-0.03467661514878273,-0.05062715709209442,-0.03093382529914379,0.022824974730610847,0.04939018934965134,-0.021028684452176094,0.004197969101369381,0.037393391132354736,-0.028176335617899895,-0.01585490256547928,-0.02675454132258892,-0.001398522756062448,0.010839952155947685,-0.0014937809901311994,0.005020319949835539,-0.0392594039440155,0.035468436777591705,0.024752793833613396,0.03639066964387894,0.022926686331629753,0.04597996547818184,0.02241627685725689,-0.0012659834465011954,-0.00739333825185895,0.02420814335346222,0.03704681247472763,-0.0196627639234066,-0.031841784715652466,-0.006799183785915375,-0.03352772817015648,0.02181745134294033,0.05579682067036629,-0.013558600097894669,0.030181091278791428,-0.006316977087408304,-0.013952523469924927,0.012330206111073494,-0.041256241500377655,0.03192669153213501,-0.01914273202419281,0.08461452275514603,-0.04409714788198471,-0.01214772742241621,0.011330503039062023,0.018481537699699402,-0.006005553063005209,0.050334520637989044,-0.002672649221494794,-0.008288771845400333,0.06209006905555725,-0.0010046516545116901,0.010663624852895737,-0.031831953674554825,0.022650688886642456,-0.0212539155036211,-0.03193394094705582,-0.012190799228847027,-0.01092712301760912,-0.016085412353277206,0.0294950008392334,-0.09827454388141632,-0.03515492379665375,-0.03178056702017784,0.011391546577215195,0.017250820994377136,-0.008856121450662613,-0.04064458608627319,-0.015738215297460556,0.006248313933610916,-0.018025370314717293,0.22370760142803192,0.006043099332600832,0.012936385348439217,-0.025930719450116158,0.06032849848270416,-0.006991071160882711,-0.011622984893620014,0.037625912576913834,-0.011367491446435452,-0.04600599780678749,-0.0017747886013239622,0.017549537122249603,-0.0005504885921254754,-0.027553657069802284,0.009912733919918537,0.04041628912091255,0.00668737106025219,-0.04864263907074928,0.056667692959308624,-0.013048314489424229,0.0067961267195641994,-0.018381819128990173,-0.02903132699429989,0.022398315370082855,0.019530439749360085,-0.02770918980240822,-0.010601629503071308,0.03488731384277344,-0.044833723455667496,0.006666871719062328,-0.0008869143784977496,-0.00881689041852951,0.04928088188171387,-0.002849663607776165,-0.03115912340581417,-0.04198518022894859,-0.005231834482401609,-0.019640298560261726,-0.023163769394159317,-0.004315787926316261,-0.04009106755256653,-0.02463514357805252,-0.0036947547923773527,0.02182174101471901,-0.0372823029756546,0.030221836641430855,0.006193005479872227,0.003403798909857869,-0.03606549650430679,-0.009063707664608955,0.022200630977749825,-0.035799380391836166,-0.0010024507064372301,0.017152471467852592,0.03343266248703003,-0.030394289642572403,-0.0015014258679002523,0.003636636072769761,-0.01756003312766552,0.020411495119333267,0.0021329200826585293,0.011021564714610577,-0.0735861286520958,0.017728058621287346,0.023705432191491127,0.05030510202050209,0.021042807027697563,-0.020785532891750336,0.0334869921207428,0.08741839975118637,-0.0117210503667593,0.0001782165199983865,0.01726897619664669,-0.016497846692800522,-0.010504627600312233,-0.01187414862215519,-0.015835637226700783,0.034667130559682846,0.02805940806865692,0.03733376786112785,0.01915065385401249,-0.02492561750113964,-0.005571269430220127,0.019386373460292816,0.008642815984785557,0.02145669236779213,0.004512604791671038,0.05554104596376419,0.0034787680488079786,-0.029752783477306366,-0.030377579852938652,-0.004558586049824953,-0.06357397139072418,-0.0061086020432412624,-0.017321696504950523,-0.008206392638385296,0.015490153804421425,0.00264244107529521,-0.050804127007722855,0.008118793368339539,0.03476586937904358,-0.025892768055200577,-0.034948062151670456,-0.026809023693203926,-0.002411295659840107,-0.06390640884637833,-0.011082773096859455,0.027057144790887833,-0.004077316261827946,0.01618964411318302,-0.0009810739429667592,0.033004630357027054,-0.029286647215485573,-0.04033875837922096,0.013788820244371891,0.002074463991448283,0.05652409419417381,-0.0017354398733004928,0.03404363989830017,-0.006880622357130051,-0.01774861477315426,-0.018313229084014893,-0.03552359342575073,-0.0241499412804842,-0.03993042930960655,-0.04111562669277191,-0.033971648663282394,0.05698266997933388,-0.023043980821967125,0.07825858145952225,0.042342230677604675,-0.03370245173573494,-0.018297547474503517,0.01990216225385666,0.06232258304953575,-0.005874479189515114,0.07475804537534714,0.017168639227747917,0.03488057479262352,0.007689229678362608,-0.003546604420989752,-0.02382161282002926,0.008269473910331726,0.05184008181095123,0.0005383225507102907,-0.03091702237725258,0.014850238338112831,-0.022906668484210968,0.005280963145196438,0.0021260471548885107,0.0075647649355232716,0.038381244987249374,0.02324162796139717,-0.052792321890592575,0.03654114156961441,0.02748439647257328,-0.026714904233813286,0.030958322808146477,0.01187271811068058,-0.03695902228355408,0.013516424223780632,0.04011475294828415,0.05052071437239647,0.058027807623147964,-0.015193523839116096,-0.028515109792351723,0.02482019178569317,0.047152336686849594,-0.004623717628419399,-0.07297758758068085,-0.022836927324533463,-0.03479558229446411,-0.07144102454185486,0.016290798783302307,0.03177016228437424,0.01441336888819933,0.022974787279963493,-0.013084933161735535,-0.005881442688405514,-0.01334321964532137,0.028493165969848633,-0.019956499338150024,-0.007063222583383322,-0.026240255683660507,0.01777167059481144,0.049458764493465424,0.0020872417371720076,-0.0036216345615684986,0.041699085384607315,0.0014556738315150142,0.010557536035776138,0.12180053442716599,0.0042220959439873695,-0.005183610133826733,0.0054078251123428345,-0.01075050886720419,0.02989562414586544,0.043644167482852936,-0.0026929841842502356,0.05072465538978577,-0.02767416276037693,-0.021618958562612534,0.004661609884351492,-0.05195184424519539,-0.008984383195638657,-0.0016476722666993737,0.001689418568275869,0.004983874969184399,-0.016171567142009735,0.03625691309571266,0.0010089717106893659,-0.01374185923486948,-0.02346370369195938,-0.0194739680737257,-0.004569245968014002,-0.0140912476927042,0.03445490077137947,0.05356881767511368,-0.021733732894062996,-0.025566138327121735,-0.00019305998284835368,-0.0100232670083642,0.018865162506699562,-0.00848840270191431,-0.044497255235910416,-0.013691495172679424,0.05164350941777229,-0.03370695188641548,-0.010106456466019154,-0.014190864749252796,-0.0003716690407600254,-0.037853680551052094,0.009384162724018097,-0.01162363775074482,0.014443009160459042,-0.022771866992115974,0.00011503294081194326,0.023730352520942688,0.019146617501974106,-0.04712327942252159,0.0008851240272633731,-0.016855042427778244,-0.013206337578594685,0.10681824386119843,-0.020240144804120064,0.0525200180709362,0.006826168857514858,-0.0027339737862348557,0.07510307431221008,0.021456290036439896,-0.042665038257837296,0.00046758705866523087,0.005679022520780563,0.0008857414941303432,0.010391597636044025,0.007729665841907263,-0.025840606540441513,-0.02985285222530365,0.007668808568269014,0.0002980357385240495,-0.016171475872397423,0.019020926207304,0.006020192988216877,0.006464902777224779,-0.026913413777947426,-0.043556589633226395,0.008232228457927704,-0.07689546048641205,-0.0052263797260820866,-0.035628072917461395,-0.02966294251382351,-0.005918087437748909,-0.03567393124103546,-0.01247942540794611,0.060361843556165695,0.002807028591632843,-0.027588142082095146,-0.007894536480307579,0.008604361675679684,0.020103173330426216,-0.07210689783096313,0.029876112937927246,-0.023141849786043167,0.0011987691977992654,-0.0008149961940944195,0.006197143346071243,0.020895564928650856,0.00037953004357405007,0.013111161068081856,-0.03845285251736641,0.0016084229573607445,-0.04168611764907837,-0.04236757382750511,0.00733993062749505,-0.03751220181584358,-0.018620682880282402,-0.021968642249703407,0.028136257082223892,0.005372560117393732,-0.010228092782199383,-0.028038909658789635,-0.0023334466386586428,-0.028629278764128685,-0.04670895263552666,-0.052376631647348404,0.03586474433541298,0.018091430887579918,-0.049946997314691544,-0.01514176744967699,0.047803860157728195,0.01699567772448063,0.015328731387853622,0.010712620802223682,0.002123685088008642,0.06415592133998871,0.024631377309560776,0.035582102835178375,0.0012244904646649957,-0.012233590707182884,0.00813966989517212,0.037902217358350754,0.029360517859458923,-0.0486132986843586,0.017687661573290825,0.03299839422106743,-0.013238496147096157,-0.013200326822698116,-0.005730216857045889,-0.01331530325114727,-0.030444618314504623,-0.033732011914253235,0.047386765480041504,-0.009842630475759506,0.005994858685880899,-0.023812925443053246,-0.01362360455095768,0.03314647823572159,0.00647759111598134,0.0250770952552557,0.0414326973259449,0.026004893705248833,0.036320049315690994,0.054730840027332306,-0.03910583257675171,0.012060780078172684,0.041371408849954605,0.002077584620565176,-0.025946158915758133,-0.025974782183766365,-0.02720918506383896,-0.007927898317575455,0.0040055844001472,-0.013832611963152885,-0.02973191626369953,0.03527991473674774,-0.009695704095065594,-0.05575500428676605,-0.03722952678799629,0.013541829772293568,-0.00865274015814066,-0.020357931032776833,0.009639723226428032,-0.0507102832198143,-0.015244240872561932,-0.019348127767443657,0.04555179551243782,0.015294121578335762,-0.007206445559859276,0.06062790006399155,-0.005111909005790949,0.004139820113778114,0.01937681809067726,0.020404402166604996,0.002552285324782133,-0.030844949185848236,0.036409102380275726,-0.006814957596361637,-0.04197080060839653,0.05024629086256027,-0.029270010069012642,0.015528818592429161,0.001503972103819251,-0.007328128442168236,-0.01840047910809517,-0.00045441105612553656,-0.0092100128531456,-0.04498742148280144,-0.009130802936851978,0.04675000160932541,0.06979136168956757,-0.04311365634202957,-0.00877243559807539,-0.0004214404325466603,0.012277666479349136,-0.14219562709331512,-0.00430926913395524,-0.021201396360993385,-0.009498199447989464,-0.017543308436870575,0.017806844785809517,-0.025756800547242165,-0.07828842848539352,0.03590783849358559,0.02816518396139145,-0.07964565604925156,0.008752426132559776,0.042080290615558624,-0.06404416263103485,0.02651718072593212,0.055071402341127396,-0.008800625801086426,-0.028176235035061836,-0.019509777426719666,0.036569271236658096,0.00906379148364067,-0.04683149978518486,0.02234005369246006,0.02516242116689682,0.023896029219031334,-0.04918082430958748,-0.0010268468176946044,-0.023550570011138916,-0.03628400340676308,-0.017949851229786873,0.04402030631899834,-0.04206490516662598,0.04107481241226196,0.04993964731693268,0.03154009208083153,0.025109808892011642,0.013614547438919544,-0.04171719774603844,-0.0031599036883562803,0.020165840163826942,-0.011632400564849377,0.03999967873096466,0.014274412766098976,-0.01187898963689804,0.032295823097229004,-0.012709599919617176,0.05827837809920311,-0.01723158359527588,-0.024798419326543808,0.0030991726089268923,0.032597899436950684,0.029943378642201424,-0.02429444156587124,0.048744626343250275,0.0011137371184304357,-0.007776426151394844,-0.034102633595466614,-0.029111959040164948,0.015030012466013432,0.04656554013490677,-0.04094461724162102,-0.011531602591276169,4.6118831960484385e-05,-0.10001746565103531,-0.010489478707313538,-0.0015569606330245733,-0.027479514479637146,0.0019341816660016775,0.013176586478948593,0.014007719233632088,-0.006951211951673031,-0.0756019651889801,-0.037204310297966,-0.025117047131061554,0.027918003499507904,0.01250455155968666,0.008491392247378826,-0.004520315211266279,-0.023112304508686066,-0.0491146594285965,0.010934853926301003,-0.009928848594427109,-0.0035737405996769667,-0.013385831378400326,0.02666373923420906,0.006644800305366516,-0.016098324209451675,0.03759223222732544,-0.028729181736707687,-0.010834852233529091,-0.020237639546394348,-0.05446283146739006,-0.02220902405679226,-0.021221645176410675,-0.03547218069434166,0.029663149267435074,-0.011989464983344078,-0.009906524792313576,-0.006016987841576338,0.009752561338245869,0.030416961759328842,-0.047963038086891174,-0.013526865281164646,0.018452998250722885,-0.021521203219890594,0.018701469525694847,0.05285897105932236,-0.0010904023656621575,0.006972190923988819,-0.03487509861588478,-0.036200184375047684,0.017229322344064713,0.006422214210033417,0.02873692847788334,-0.041057173162698746,-0.00750432163476944,0.05745010823011398,-0.007179181091487408,-0.017404083162546158,0.017651472240686417,-0.01599116250872612,0.002535711508244276,0.011545952409505844,-0.03415549546480179,0.0005909449537284672,0.01335767563432455,0.05411890894174576,0.007383115589618683,0.007445705588907003,-0.017489442601799965,0.011805353686213493,-0.012042094953358173,0.005274818744510412,0.03236418217420578,0.03646424040198326,-0.06665074825286865,-0.019605418667197227,0.05144963786005974,-0.027477338910102844,-0.03461708873510361,-0.05672290548682213,0.01851639710366726,0.024274040013551712,-0.0470280684530735,0.01059630885720253,-0.004326973110437393,-0.04125908017158508,0.0022801600862294436,-0.045498285442590714,-0.006944847758859396,0.03445719555020332,-0.009896100498735905,-0.012551878578960896,0.01959688775241375,-0.021050885319709778,0.04245401918888092,-0.037523407489061356,-0.03017435409128666,0.009188764728605747,-0.008055423386394978,-0.02664773538708687,0.012918847613036633,-0.014927655458450317,0.04965515434741974,-0.017271872609853745,-0.022227248176932335,-0.0227284487336874,-0.004705421160906553,-0.033305756747722626,0.002648882567882538,-0.005779338534921408,0.014533694833517075,-0.013593053445219994,0.04263252764940262,0.02904282882809639,-0.07667391747236252,0.022012075409293175,0.008652359247207642,0.04519110918045044,-0.01619795337319374,0.00044568892917595804,-0.02074517495930195,0.004130502697080374,0.00022689816250931472,0.053020164370536804,-0.012851173058152199,-0.024143502116203308,0.06575654447078705,0.014508445747196674,0.0024358986411243677,-0.012151635251939297,0.01383469719439745,0.041081752628088,-0.031509026885032654,0.01629532128572464,0.03418257459998131,-0.007328009698539972,0.05706708878278732,-0.0035665929317474365,0.029910331591963768,-0.030345812439918518,0.041055403649806976,-0.034993771463632584,-0.05910377576947212,0.02390240877866745,-0.0036049620248377323,-0.011457656510174274,-0.026312116533517838,-0.009664950892329216,-0.01770581677556038,-0.007549853529781103,-0.007084082346409559,-0.0038768649101257324,0.04494233801960945,0.0034482809714972973,-0.021237505599856377,0.024455199018120766,0.05279000476002693,-0.01997961848974228,0.028929967433214188,-0.01043784897774458,0.036516424268484116,-0.06251353770494461,-0.012730982154607773,-0.01633322983980179,-0.013615496456623077,-0.020573323592543602,0.02139892429113388,-0.0033865063451230526,-0.04148336127400398,0.01212544459849596,-0.015159036964178085,0.01337565016001463,0.03254852071404457,0.0395018570125103,-0.0424620695412159,0.053009994328022,0.01647733338177204,-0.007640088442713022,-0.013958015479147434,0.021169302985072136,-0.006630351766943932,-0.0018147891387343407,-0.0404183603823185],"k":600,"num_candidates":800,"_name":"knn_query"}}],"minimum_should_match":1}}],"filter":[{"term":{"platform_sku_essa":true}},{"term":{"platform_rule_essa":true}},{"terms":{"status":[2,4,5]}}]}},"functions":[{"filter":{"term":{"label_id_list":156}},"weight":1.14},{"filter":{"term":{"label_id_list":157}},"weight":1.13},{"filter":{"term":{"label_id_list":158}},"weight":1.1},{"filter":{"term":{"label_id_list":159}},"weight":1.1},{"filter":{"term":{"label_id_list":162}},"weight":1.05},{"filter":{"term":{"label_id_list":163}},"weight":1.1},{"filter":{"term":{"label_id_list":164}},"weight":1.13},{"filter":{"term":{"label_id_list":165}},"weight":1.15},{"field_value_factor":{"field":"on_sell_days_boost","missing":1.0}},{"filter":{"term":{"is_video":true}},"weight":1.2}],"score_mode":"max","boost_mode":"multiply"}},"track_scores":true,"collapse":{"field":"goods_id"},"aggs":{"unique_count":{"cardinality":{"field":"goods_id"}}}} - -#### 8888883840386376 -2025-07-02 07:45:29,565 - INFO - [REQ: 8888883840386376 UID: 9987] qt:kwd_factory total:4.385730504989624ms TIMING: QA=80ms, queryEncoding=34ms, userProfile=1ms, ES=593ms, BgeReranking=0ms, BizReranking=0ms, Reranking=0ms, total=4386ms, brand_statistics_query=3710ms - -2025-07-02 07:45:25,179 - INFO - [REQ: 8888883840386376 UID: 9987] REQUEST POST structure: {"keyword":"澳高","kt":"kwd_factory","page":1,"size":100,"request_id":8888883840386376,"extra":{"userId":9987,"businessPlatform":"trader"}} - -2025-07-02 07:45:25,854 - INFO - [REQ: 8888883840386376 UID: 9987] ES_query_timing # FactoryKeywordSearch # 592.97 # {"query":{"bool":{"must":[{"bool":{"should":[{"multi_match":{"query":"澳高","fields":["brand_name_zh^10.0","name_zh^2.0","supplier_name^8.0"],"minimum_should_match":"66%","tie_breaker":0.3}},{"term":{"no":{"value":"澳高","boost":15.0}}},{"term":{"hs_no":{"value":"澳高","boost":15.0}}},{"term":{"factory_no":{"value":"澳高","boost":15.0}}},{"term":{"factory_no_buyer":{"value":"澳高","boost":15.0}}},{"term":{"supplier_code":{"value":"澳高","boost":15.0}}},{"match":{"factory_no_fuzzy":{"query":"澳高","boost":5.0}}},{"match":{"factory_no_buyer_fuzzy":{"query":"澳高","boost":5.0}}}],"minimum_should_match":1}}],"filter":[{"term":{"platform_sku_trader":true}},{"term":{"platform_rule_trader":true}},{"bool":{"should":[{"bool":{"must_not":{"exists":{"field":"trader_buyer_ids"}}}},{"term":{"trader_buyer_ids":9987}}]}},{"terms":{"status":[2,4,5]}}]}},"_source":["id","goods_id","brand_id","name_zh","category_name_zh","sub_name_zh","label_id_list","category_id","price_range","on_sell_days_boost","brand_name_zh","supplier_name","is_video"],"from":0,"size":100,"collapse":{"field":"brand_id"},"aggs":{"category_stats":{"terms":{"field":"sale_category_one_all","size":10}},"factory_certification_stats":{"terms":{"field":"supplier_certification_type_list","size":10}},"sale_market_stats":{"terms":{"field":"supplier_main_market_list","size":10}},"factory_category_stats":{"terms":{"field":"supplier_main_category_list","size":10}},"unique_count":{"cardinality":{"field":"brand_id"}}}} - - -### 0701 启动后 第一次查询 - -2025-07-01 15:10:24,560 - INFO - [REQ: 99996874 UID: 11010] qt:kwd total:15.652546644210815ms TIMING: QA=248ms, queryEncoding=0ms, userProfile=2ms, ES=14733ms, BgeReranking=503ms, BizReranking=7ms, Reranking=514ms, total=15653ms, sku_id_list_filling=144ms - -2025-07-01 15:10:08,908 - INFO - [REQ: 99996874 UID: 11010] REQUEST POST structure: {"query":"积木车","kt":"kwd","top_k":5000,"recall_merge_output_size":5000,"rerank_size":1000,"rerank_enabled":true,"page":1,"size":100,"debug":"0","from_search_debug":1,"extra":{"userId":11010,"businessPlatform":"trader"}} - -2025-07-01 15:10:24,415 - INFO - [REQ: 99996874 UID: 11010] ES_query_timing # ProductKeywordSearch # 14732.69 # {"size":1000,"from":0,"_source":{"includes":["name_zh","is_star","category_name_zh","sub_name_zh","label_id_list","is_video","brand_id","category_id","sale_category_all","price_range","on_sell_days_boost","brand_name_zh","supplier_name"]},"query":{"function_score":{"query":{"bool":{"must":[{"bool":{"should":[{"multi_match":{"query":"积木车","fields":["name_zh^2.0","goods_keyword_zh^1.0","category_name_zh^1.0","sale_category_keyword_zh^1.0","sub_name_zh^1.0"],"minimum_should_match":"66%","tie_breaker":0.3,"_name":"base_query"}},{"knn":{"field":"embedding_name_zh","query_vector":[-0.0021524359472095966,-0.008107833564281464,-0.029764598235487938,0.0008246809593401849,-0.040078889578580856,-0.006073615048080683,0.011918029747903347,0.019061563536524773,-0.030276576057076454,-0.008857600390911102,0.015921179205179214,0.019418299198150635,-0.004340778570622206,0.032456833869218826,0.026495972648262978,-0.013638369739055634,0.009577512741088867,0.05024699121713638,-0.002644563792273402,-0.056296054273843765,-0.003823563689365983,-0.02251642569899559,0.039393797516822815,0.007878373377025127,0.033576302230358124,0.03129247575998306,-0.0017715205904096365,-0.005420100875198841,0.010666202753782272,-0.03803142532706261,0.04202716797590256,-0.0036040968261659145,-0.0028934082947671413,-0.04637492075562477,-0.0489245168864727,-0.03738679736852646,0.0038137363735586405,-0.016817262396216393,-0.04795883595943451,0.05358966439962387,-0.01840907894074917,0.002011107513681054,0.02920212596654892,-0.006401093676686287,-0.0030216253362596035,-0.0013409669045358896,0.030354607850313187,-0.014434156008064747,-0.007749649230390787,0.026039982214570045,-0.008697780780494213,0.019168002530932426,0.07524910569190979,-0.042920466512441635,-0.008408952504396439,0.013219775632023811,-0.03873486816883087,-0.05833493545651436,-0.083629310131073,-0.029803313314914703,-0.03472751006484032,0.005717243067920208,-0.0226939357817173,-0.0016026428202167153,0.02288738079369068,0.10437139123678207,-0.012227358296513557,0.001420297659933567,-0.011135675013065338,-0.0664505809545517,-0.043076127767562866,-0.0029975650832057,-0.03185959532856941,-0.01608896255493164,-0.037143900990486145,0.03871254622936249,0.02565511129796505,0.0019380551530048251,-0.051922500133514404,0.003943318501114845,0.03325793519616127,-0.02121022157371044,0.013436833396553993,0.02082972601056099,0.0055800192058086395,-0.011569220572710037,-0.019480425864458084,0.004300588276237249,-0.02139301225543022,0.052772145718336105,-0.016601400449872017,-0.01394728198647499,0.009624723345041275,-0.034984245896339417,-0.04199494421482086,-0.030347228050231934,0.003312210086733103,0.02941184490919113,0.04211102053523064,0.0008835332118906081,0.026741022244095802,0.005722839385271072,0.008748107589781284,-0.01780589111149311,-0.028155015781521797,-0.06471167504787445,0.02908491902053356,0.010580305010080338,0.005717920139431953,-0.01443113200366497,-0.007160497829318047,0.03158904239535332,0.00443205377086997,-0.0002449769526720047,0.00032021026709116995,-0.018649997189641,-0.013081124052405357,0.005840871017426252,0.022754283621907234,0.00038412288995459676,0.03662636876106262,0.0015330958412960172,0.028473608195781708,0.002789353020489216,0.013041779398918152,-0.024487949907779694,-0.005734704900532961,-0.008972971700131893,0.013888053596019745,-0.0005149265634827316,0.02040003426373005,0.029574397951364517,-0.030044572427868843,-0.006543997209519148,-0.0024162638001143932,-0.03538169339299202,0.05170788988471031,-0.008383621461689472,-0.018639560788869858,-0.05566595867276192,-0.0006145948427729309,0.06543915718793869,-0.006052026525139809,-0.05874686688184738,0.0069569977931678295,-0.05807267874479294,0.05126497521996498,-0.00788998231291771,-0.008304163813591003,-0.027954386547207832,0.013678958639502525,0.022278638556599617,0.041264116764068604,0.017783891409635544,0.024431833997368813,-0.024646008387207985,0.009298823773860931,0.008236299268901348,-0.03247912600636482,0.015482714399695396,0.00038719220901839435,0.05515728145837784,-0.004987176042050123,-0.008741161786019802,-0.0023540486581623554,-0.06015388295054436,0.06123318150639534,0.027333028614521027,0.003739637788385153,-0.01502145268023014,0.004994833376258612,-0.03815867751836777,0.024375803768634796,0.013542595319449902,0.007177951745688915,0.021070610731840134,0.0926181972026825,0.014546383172273636,0.0328536257147789,-0.05456337705254555,-0.010433388873934746,0.008905144408345222,0.010454634204506874,-0.05243987962603569,-0.04009335860610008,0.032108478248119354,0.021958496421575546,-0.028974879533052444,0.010772105306386948,0.007837618701159954,-0.04730592668056488,-0.057198088616132736,-0.005038625095039606,-0.04818981513381004,0.031043333932757378,0.03901030495762825,0.00877933669835329,-0.015933558344841003,0.006942194886505604,-0.04809608310461044,0.043025385588407516,0.0043589770793914795,0.029627831652760506,-0.0027638510800898075,0.0043422565795481205,-0.00976208969950676,-0.007741814479231834,-0.01441408321261406,0.04136406257748604,-0.030481336638331413,0.015116587281227112,0.05261996388435364,-0.010116422548890114,-0.006042817607522011,-0.023958636447787285,-0.0458344928920269,-0.02643308974802494,0.040540117770433426,0.011701489798724651,0.02358323335647583,-0.035595376044511795,-0.027484813705086708,-0.008031305857002735,0.029444141313433647,0.0028918662574142218,-0.021969232708215714,0.022328602150082588,0.08823686093091965,0.0068029602989554405,-0.02103363908827305,-0.024456510320305824,0.023317944258451462,-0.025757895782589912,-0.010184992104768753,-0.016762834042310715,0.0018494194373488426,-0.0026936104986816645,0.010300536639988422,0.052759379148483276,0.027439579367637634,-0.010008060373365879,0.022467883303761482,-0.011797384358942509,0.022044146433472633,-1.3175530511944089e-05,-0.00045528641203418374,0.030866634100675583,0.03751451522111893,-0.01813993789255619,-0.02804294228553772,0.0014048550510779023,0.004565953277051449,-0.0016563588287681341,-0.023749910295009613,-0.015372049994766712,0.021440651267766953,0.01252153143286705,-0.013254334218800068,-0.01739756017923355,-0.029223432764410973,0.017711658030748367,0.03152080997824669,-0.004094158764928579,0.04269825294613838,0.020384935662150383,-0.04358230158686638,-0.03132731094956398,0.033803541213274,0.024181393906474113,-0.04478638991713524,-0.03499162942171097,0.021012023091316223,-0.008845007047057152,-0.024362096562981606,-0.0139074781909585,-0.027427630499005318,-0.040660783648490906,-0.0196492001414299,0.06112941354513168,0.022548330947756767,0.0338263139128685,-0.03196163475513458,0.00892527773976326,-0.00610659783706069,0.027038536965847015,-0.018952051177620888,-0.014648749493062496,-0.031623926013708115,0.027128929272294044,-0.087367482483387,0.008742256090044975,-0.004130226559937,0.06409017741680145,0.012657399289309978,-0.020537547767162323,0.007053192239254713,0.012734713964164257,-0.1552649736404419,-0.03443276882171631,-0.005799517966806889,0.013326657004654408,-0.0018917110282927752,-0.006266586482524872,-0.09289218485355377,-0.02573857270181179,-0.030639585107564926,0.07345457375049591,-0.00020668204524554312,-0.05569712445139885,-0.0016944733215495944,-0.01832824945449829,-0.019985295832157135,0.010904115624725819,0.020684650167822838,-0.01103052869439125,-0.0027708131819963455,-0.03966747596859932,-0.05894359201192856,-0.00985708273947239,0.04881586506962776,0.016122115775942802,-0.010426975786685944,-0.015283441171050072,0.013112197630107403,-0.013165329582989216,-0.035223446786403656,-0.0008697658777236938,-0.02840181067585945,-0.0010744782630354166,-0.012925480492413044,0.044555746018886566,0.009398666210472584,0.061517134308815,0.03688885271549225,0.028642358258366585,-0.01860814169049263,0.022029319778084755,0.008004609495401382,0.00821618176996708,0.016734670847654343,0.006471497472375631,0.003730524331331253,-0.008796396665275097,-0.0074549890123307705,0.02069988287985325,-0.030744746327400208,-0.006338813342154026,0.0253937728703022,-0.034629128873348236,0.030959444120526314,-0.004648637492209673,-0.02333318255841732,-0.010571219027042389,0.01853341795504093,0.03412136808037758,-0.014929739758372307,0.06304692476987839,-0.08330893516540527,0.002655221149325371,0.01382172666490078,0.04286998137831688,-0.014280414208769798,0.032440152019262314,-0.021224746480584145,0.00020794977899640799,0.054403550922870636,-0.01180355902761221,-0.01072473544627428,-0.02522001601755619,0.011840219609439373,-0.014453714713454247,-0.038930755108594894,-0.006260146852582693,-0.05281693488359451,-0.05747189000248909,0.012676840648055077,-0.08696306496858597,-0.010713816620409489,0.007824697531759739,-0.02255372144281864,0.011827881447970867,-0.0065089804120361805,-0.03725752979516983,-0.018521690741181374,0.04106614366173744,0.018148278817534447,0.23312987387180328,-0.014090578071773052,0.016248833388090134,0.01127681229263544,0.05765477567911148,0.015727991238236427,0.00946797151118517,0.0031675961799919605,-0.03734290227293968,-0.03255750983953476,0.0182870514690876,0.007358734030276537,-0.022447505965828896,-0.026112454012036324,0.01635131426155567,0.04619167745113373,0.02413603663444519,-0.0407564602792263,0.09370268881320953,-0.025074772536754608,-0.00029483612161129713,-0.018697509542107582,-0.01781277358531952,0.017940673977136612,-0.02972322516143322,0.00024119814042933285,-0.022535981610417366,0.009964799508452415,-0.021998129785060883,0.024504350498318672,-0.005922492127865553,0.0021572797559201717,0.04125651344656944,0.0047308299690485,0.013808893971145153,-0.008898098953068256,-0.03205633908510208,-0.018167994916439056,0.0030818094965070486,0.007267059292644262,-0.02025766484439373,-0.02215166948735714,-0.030655503273010254,0.03830377012491226,0.005981022026389837,0.03742852807044983,0.020476529374718666,0.017463959753513336,-0.04439929872751236,0.0004590617900248617,0.0256186630576849,-0.04552275314927101,-0.009011787362396717,0.057703666388988495,-0.00494146766141057,-0.03310084342956543,0.005579948425292969,0.015488170087337494,-0.024067174643278122,0.031143829226493835,-0.022571805864572525,0.002964159706607461,-0.058006830513477325,0.0283556766808033,0.040942154824733734,0.017844954505562782,0.03505164012312889,0.0143186766654253,0.019413070753216743,0.047896355390548706,0.006573976017534733,0.02589588426053524,-0.006083318963646889,-0.05251375213265419,0.032565075904130936,0.005573251750320196,-0.029710937291383743,0.014190850779414177,0.0360872745513916,0.0035467869602143764,0.016834037378430367,-0.019506607204675674,-0.025557391345500946,0.017378561198711395,0.033644337207078934,-0.01754351332783699,-0.012809148989617825,0.01448732241988182,0.0279574953019619,-0.01765974797308445,-0.04071679338812828,0.0009586800588294864,-0.023854324594140053,-0.02147866226732731,-0.07723361998796463,-0.009058748371899128,0.040198519825935364,0.01204153336584568,-0.04439648985862732,0.011944795958697796,0.017168762162327766,-0.010023520328104496,-0.006161050871014595,-0.017953239381313324,-0.0008542825817130506,0.013084064237773418,0.030334994196891785,-0.0037808723282068968,0.014176527969539165,0.006537510547786951,0.024642817676067352,0.024845825508236885,-0.022497717291116714,0.003762215841561556,-0.033537302166223526,-0.02540391869843006,0.0312526598572731,0.0014003848191350698,0.018620852380990982,0.06406458467245102,-0.03934227675199509,-0.026771441102027893,-0.026208680123090744,-0.04102228581905365,-0.0270833857357502,-0.0371842123568058,0.03195386752486229,-0.0005223327898420393,-0.03742726892232895,0.07725945860147476,0.032983504235744476,-0.031122945249080658,-0.045543745160102844,0.032277967780828476,0.05918898805975914,-0.027791693806648254,0.06387126445770264,0.023617131635546684,0.05752670764923096,-0.02803068235516548,-0.010680115781724453,-0.022160986438393593,-0.011746326461434364,-0.008686578832566738,0.007741359528154135,-0.0062912022694945335,0.015117891132831573,-0.0504550077021122,-0.027555646374821663,0.005645196884870529,0.03199009969830513,0.04541085660457611,0.018509844318032265,-0.04988311603665352,0.0019933488219976425,0.007733427453786135,-0.009433378465473652,0.008698632940649986,-0.021730277687311172,-0.03974450007081032,0.023893440142273903,0.03154609352350235,0.033038459718227386,0.05710946395993233,-0.024973005056381226,0.016246620565652847,0.024769118055701256,0.04433866962790489,0.014308245852589607,-0.045840609818696976,0.027106719091534615,-0.019007112830877304,-0.04810561612248421,0.02759348414838314,0.08240367472171783,0.02096753567457199,-0.00416744127869606,-0.020258115604519844,-0.01906486786901951,0.013792135752737522,-0.00884083192795515,-0.01788301207125187,0.01874888874590397,-0.03870024532079697,-0.002507546916604042,0.023538006469607353,-0.019283248111605644,-0.01345799583941698,0.01689094491302967,-0.003734003519639373,-0.015246883034706116,0.10167922079563141,0.002215425716713071,-0.01618504896759987,-0.0015069530345499516,-0.03562147170305252,-0.004937139339745045,0.0007552902097813785,-0.0033826816361397505,0.004935006611049175,-0.018421879038214684,-0.0266331285238266,-0.0032839688938111067,-0.025602977722883224,-0.013660518452525139,0.00856244657188654,-0.02488720417022705,0.01565670408308506,0.010058961808681488,-0.009137501008808613,-0.007183379959315062,-0.029949260875582695,-0.016903936862945557,-0.02664032205939293,-0.0026719740126281977,-0.02189408615231514,0.03345991671085358,0.0245782732963562,-0.0582994781434536,-0.00568669056519866,0.0040232595056295395,-0.01667124032974243,0.052253250032663345,-0.0023887353017926216,-0.03843231499195099,-0.018974334001541138,0.0374433770775795,-0.029200579971075058,0.006642875727266073,0.04284786805510521,0.005079883616417646,0.044204726815223694,-0.050280727446079254,-0.0030483368318527937,0.018859531730413437,0.016609109938144684,0.04063723236322403,0.03662716597318649,0.017424730584025383,-0.05511152744293213,0.012393343262374401,-0.052537936717271805,-0.011534972116351128,0.09142953902482986,-0.037017758935689926,0.03191547840833664,-0.0011108381440863013,-0.015503648668527603,0.09541337937116623,0.04027377814054489,-0.02521558478474617,0.0025058649480342865,0.02207014337182045,-0.004655528347939253,-0.014539115130901337,0.01584828458726406,0.02960776910185814,-0.03246964141726494,-0.015777749940752983,-0.028405562043190002,-0.0325256809592247,0.04164791852235794,-0.015093624591827393,0.01791227050125599,-0.0053864638321101665,-0.062485549598932266,0.014980792067945004,-0.07676522433757782,0.01933562196791172,-0.02318069152534008,-0.03381315991282463,-0.01226354856044054,-0.029262298718094826,-0.03077603131532669,0.0043533798307180405,0.032050326466560364,-0.0032636383548378944,0.011057293973863125,0.012763677164912224,0.02708243392407894,-0.04477400332689285,-0.005059266462922096,-0.02746930904686451,-0.01495356298983097,0.012080458924174309,-0.02930055372416973,0.022455070167779922,-0.006186312064528465,0.012239658273756504,-0.056182049214839935,-0.012763277627527714,-0.03393477573990822,-0.026735682040452957,0.010735822841525078,-0.030875341966748238,-0.019251223653554916,-0.051349807530641556,0.04196283966302872,-0.029140431433916092,-0.022665003314614296,-0.028535345569252968,0.02563866414129734,-0.031149370595812798,-0.02313033491373062,-0.041975896805524826,0.033878181129693985,0.018033476546406746,-0.04503728821873665,0.01451121736317873,0.01986190304160118,-0.0112045519053936,0.0022888975217938423,0.010853433981537819,-0.03081909380853176,0.03367147967219353,0.008152400143444538,-0.008445621468126774,-0.0069310967810451984,-0.005846841726452112,0.04007423669099808,-0.010478340089321136,0.003632578067481518,-0.05679529160261154,-0.007903935387730598,0.015483321622014046,-0.005587068852037191,0.014209503307938576,0.004649599082767963,-0.004043999128043652,-0.041941024363040924,-0.0037290018517524004,-0.0003034354595001787,-0.02196478843688965,-0.0035335738211870193,-0.013874325901269913,0.010820210911333561,0.0057076942175626755,-0.03366489335894585,-0.004135465249419212,0.0280380230396986,0.03273744136095047,0.018154531717300415,0.04654344171285629,-0.037046708166599274,0.0475095771253109,0.03073061630129814,-0.009450764395296574,-0.01001717709004879,0.00536694098263979,-0.025302181020379066,0.008918129839003086,0.019043093547225,-0.011608882807195187,-0.014153755269944668,0.03197164088487625,-0.007570689544081688,-0.053325723856687546,-0.012190615758299828,-0.013835873454809189,-0.007214938290417194,-0.033833518624305725,0.02794158272445202,-0.043069664388895035,-0.005416421685367823,-0.01889304257929325,0.048966776579618454,0.0072764926590025425,0.013816933147609234,0.06535563617944717,0.006311641540378332,-0.006707347463816404,-0.0352039635181427,-0.007175379898399115,0.0071813007816672325,0.0032109459862113,0.04923095181584358,-0.0004961849772371352,-0.022697051987051964,0.0007138533401302993,-0.034034986048936844,0.016270918771624565,0.003717052284628153,0.01697886735200882,-0.01975543424487114,0.039609394967556,-0.02062390185892582,-0.06586196273565292,0.00756759662181139,0.03938873112201691,0.03567376732826233,-0.048646848648786545,-0.03521135076880455,-0.02724856324493885,0.007512927986681461,-0.14108328521251678,0.03747677803039551,-0.01291686575859785,-0.028617428615689278,-0.05360802263021469,0.02828209288418293,-0.027074536308646202,-0.054799556732177734,0.021222947165369987,-0.016730189323425293,-0.0714416578412056,-0.00894789770245552,0.04949968680739403,-0.036847881972789764,0.01872086524963379,0.06436192244291306,0.019862260669469833,-0.030302345752716064,-0.007061121519654989,0.015498452819883823,-0.00441434932872653,-0.005172411911189556,0.0715278908610344,0.031627822667360306,-0.0035775310825556517,-0.033065617084503174,0.010293131694197655,0.01225349772721529,-0.024923870339989662,0.016770552843809128,-0.006837135646492243,-0.05347704514861107,0.01712893508374691,0.08052338659763336,0.0452919527888298,0.027423730120062828,0.017372475937008858,-0.04497986659407616,-0.013707904145121574,0.0180472694337368,0.019366011023521423,0.029807746410369873,-0.0020171261858195066,0.027545781806111336,0.0005783095839433372,0.0052664210088551044,0.02249046228826046,-0.00868252757936716,-0.013710943050682545,0.009558163583278656,0.002748706843703985,0.023087885230779648,0.002986074425280094,0.029210377484560013,0.013242463581264019,-0.023239193484187126,-0.020963486284017563,-0.055765364319086075,0.024110082536935806,0.05231046304106712,-0.00956584233790636,0.02121114730834961,-0.025239259004592896,-0.0946902483701706,-0.039695486426353455,-0.005382890347391367,-0.034302305430173874,0.0018533205147832632,0.06796300411224365,0.027097562327980995,0.013307681307196617,-0.059225697070360184,-0.006225021556019783,-0.009755522944033146,0.020239073783159256,0.022693298757076263,0.0411948598921299,0.006173071917146444,-0.04946613311767578,-0.0362771637737751,-0.020803051069378853,0.025593405589461327,-0.0006749304011464119,0.003253212431445718,0.012986235320568085,-0.0032602206338196993,-0.03639553487300873,0.05997848883271217,-0.05154813826084137,0.008660460822284222,-0.016708508133888245,-0.02752944640815258,-0.024387666955590248,-0.004524093121290207,0.004924986977130175,0.007002477068454027,-0.013311495073139668,0.013337369076907635,-0.02140575833618641,-0.01811077445745468,-0.003214634954929352,0.007181718945503235,0.007522390689700842,-0.017910225316882133,-0.0013092863373458385,0.023208608850836754,0.019766826182603836,-0.0020718665327876806,0.015326851047575474,-0.01997850090265274,-0.023913022130727768,-0.027809714898467064,0.00522984191775322,-0.006423330400139093,-0.05896889045834541,-0.008351332508027554,0.037767525762319565,-0.010563126765191555,-0.04010838270187378,0.012037806212902069,0.01449983287602663,-0.008654217235744,0.03958940505981445,-0.041072919964790344,-0.020386384800076485,0.016278039664030075,0.03609130531549454,-0.00932556577026844,0.02303696796298027,-0.011356515809893608,0.01134386658668518,-0.029857710003852844,0.041478242725133896,0.02560768648982048,0.027723217383027077,-0.013846679590642452,-0.006710059009492397,0.0533745177090168,-0.004539508372545242,-0.037180494517087936,-0.05059074983000755,0.010428684763610363,-0.0013235608348622918,-0.050717439502477646,-0.02790592983365059,-0.013537339866161346,-0.037436746060848236,-0.00787926185876131,-0.03954906016588211,-0.05071116238832474,0.026204537600278854,0.002853244775906205,-0.004444602411240339,0.008540390059351921,0.0037303552962839603,0.04376672953367233,-0.027974246069788933,0.007798444014042616,-0.002806631848216057,0.01825649105012417,0.0049882205203175545,-0.008621595799922943,-0.00796885509043932,0.026042580604553223,0.001026156242005527,0.014937580563127995,-0.025604236871004105,0.01384399738162756,-0.03421280160546303,-0.01651141606271267,-0.033375389873981476,-0.010832262225449085,-0.0071794334799051285,0.03804642707109451,0.03441499173641205,-0.054669156670570374,0.021820666268467903,-0.005702161230146885,0.039233241230249405,-0.003689537523314357,0.012676684185862541,0.0074905212968587875,0.022044047713279724,0.01034513022750616,0.04489839822053909,0.0026726643554866314,-0.016389921307563782,0.0721321702003479,0.030039990320801735,0.046596869826316833,0.008214130997657776,-0.01008486095815897,0.059578366577625275,-0.005294167436659336,0.05520564317703247,0.03682423755526543,-0.024427372962236404,0.0493122823536396,-0.0029275345150381327,0.047900039702653885,-0.03625209257006645,-0.008139371871948242,-0.016370030120015144,-0.013061241246759892,-0.025937354192137718,0.018791822716593742,0.007310884539037943,-0.022234100848436356,-0.01127785537391901,-0.01773921214044094,-0.022473379969596863,-0.021747006103396416,-0.0039264364168047905,0.024716513231396675,-0.013713193126022816,-0.019176652655005455,0.007130912970751524,0.03963853791356087,-0.024430224671959877,0.052942048758268356,-0.006402516271919012,0.02781028486788273,-0.0398385263979435,0.006198063492774963,-0.02492978423833847,-0.004867245443165302,-0.06440611183643341,-0.02933618240058422,0.0036015156656503677,-0.026202373206615448,0.022264158353209496,0.0016737349797040224,0.0047467234544456005,0.015019385144114494,0.025666475296020508,-0.02535399980843067,0.03414227440953255,0.019933506846427917,0.04195677861571312,-0.062302686274051666,0.016360249370336533,-0.0017109195468947291,0.014784248545765877,0.006924598477780819],"k":600,"num_candidates":800,"_name":"knn_query"}}],"minimum_should_match":1}}],"filter":[{"term":{"platform_sku_trader":true}},{"term":{"platform_rule_trader":true}},{"bool":{"should":[{"bool":{"must_not":{"exists":{"field":"trader_buyer_ids"}}}},{"term":{"trader_buyer_ids":11010}}]}},{"terms":{"status":[2,4,5]}}]}},"functions":[{"filter":{"term":{"label_id_list":156}},"weight":1.14},{"filter":{"term":{"label_id_list":157}},"weight":1.13},{"filter":{"term":{"label_id_list":158}},"weight":1.1},{"filter":{"term":{"label_id_list":159}},"weight":1.1},{"filter":{"term":{"label_id_list":162}},"weight":1.05},{"filter":{"term":{"label_id_list":163}},"weight":1.1},{"filter":{"term":{"label_id_list":164}},"weight":1.13},{"filter":{"term":{"label_id_list":165}},"weight":1.15},{"field_value_factor":{"field":"on_sell_days_boost","missing":1.0}},{"filter":{"term":{"is_video":true}},"weight":1.2},{"filter":{"terms":{"sku_id":[2388172,2185613,2121891]}},"weight":1.2}],"score_mode":"max","boost_mode":"multiply"}},"track_scores":true,"collapse":{"field":"goods_id"},"aggs":{"unique_count":{"cardinality":{"field":"goods_id"}}}} - - - -2025-06-29 21:58:26,099 - INFO - [REQ: 7621648571687939 UID: 12883] TIMING: QA=89ms, queryEncoding=38ms, userProfile=0ms, ES=12407ms, BgeReranking=43ms, BizReranking=1ms, Reranking=44ms, total=12594ms, sku_id_list_filling=50ms - -{"size":1000,"from":0,"_source":{"includes":["name_zh","is_star","category_name_zh","sub_name_zh","label_id_list","is_video","brand_id","category_id","sale_category_all","price_range","on_sell_days_boost","brand_name_zh","supplier_name"]},"query":{"function_score":{"query":{"bool":{"must":[{"bool":{"should":[{"multi_match":{"query":"婴儿游泳叭圈","fields":["name_zh^2.0","goods_keyword_zh^1.0","category_name_zh^1.0","sale_category_keyword_zh^1.0","sub_name_zh^1.0"],"minimum_should_match":"66%","tie_breaker":0.3,"_name":"base_query"}},{"knn":{"field":"embedding_name_zh","query_vector":[-0.01478106901049614,0.013851337134838104,-0.055754996836185455,0.00896596722304821,-0.035678550601005554,0.011876722797751427,-0.0468246228992939,0.002370002679526806,-0.008833633735775948,-0.013886653818190098,0.005371053237468004,0.014607803896069527,-0.026950594037771225,0.009789489209651947,0.037642937153577805,-0.01866260915994644,0.005209847819060087,0.02765592560172081,0.023023366928100586,-0.04377084970474243,-0.022735562175512314,0.00786507222801447,-0.02201155759394169,-0.0025800715666264296,0.02735256962478161,0.008907552808523178,-0.0007465820526704192,-5.53255777049344e-05,-0.013690521009266376,-0.026607664301991463,0.00973280519247055,0.019667286425828934,-0.017879927530884743,-0.06314889341592789,-0.009382741525769234,-0.06508748978376389,-0.019463876262307167,0.006836523301899433,-0.043444592505693436,0.0657905861735344,-0.011680386029183865,-0.005935718771070242,0.015079094097018242,0.02610080875456333,0.02284662239253521,-0.014283453114330769,0.01882733218371868,-0.025137750431895256,-0.02017633244395256,-0.024488935247063637,-0.018697349354624748,0.014619751833379269,0.029269011691212654,-0.017477717250585556,0.006322234403342009,0.03211721405386925,-0.021374624222517014,-0.029504645615816116,-0.06616988778114319,-0.036163579672575,-0.013338882476091385,-0.01617359183728695,-0.04116946458816528,0.026660947129130363,0.008928346447646618,0.10984474420547485,0.010123053565621376,-0.01621401309967041,-0.027820462360978127,-0.04593786224722862,-0.038563843816518784,0.025001462548971176,0.004857074469327927,-0.0024321400560438633,-0.04466858133673668,0.05484404042363167,0.008686342276632786,-0.0003515953430905938,0.008685621432960033,-0.018227847293019295,0.047262199223041534,-0.008053619414567947,-0.01761087030172348,0.007228255737572908,-0.03889349102973938,0.02386181242763996,-0.0228823684155941,-0.022754788398742676,0.0016211157198995352,-0.0035532936453819275,-0.021663568913936615,-0.006626194342970848,0.022327415645122528,-0.035443294793367386,0.019731944426894188,0.04754151403903961,0.017493415623903275,-0.022076735273003578,0.04263211041688919,0.01102732215076685,0.019614174962043762,0.009782286360859871,-0.027961768209934235,-0.0315760001540184,0.0027029807679355145,-0.03642409294843674,0.06655669212341309,0.024716848507523537,0.01797829382121563,0.004849161021411419,0.0043105133809149265,0.006638331804424524,-0.014820436015725136,0.04238307103514671,0.024094264954328537,-0.03936127573251724,-0.05168687179684639,0.011486952193081379,-0.0034848363138735294,-0.012619306333363056,0.0060675060376524925,-8.145697938743979e-05,0.027002284303307533,-0.018612802028656006,0.020482657477259636,1.8866128812078387e-05,-0.019893649965524673,-0.0193052776157856,0.012323510833084583,0.029035022482275963,0.03360322490334511,0.05084170773625374,-0.017852783203125,0.020378144457936287,-0.01218657661229372,-0.006937084719538689,0.053081151098012924,0.03357801213860512,-0.022793013602495193,-0.02143709734082222,0.02176191657781601,0.055819615721702576,0.0038024240639060736,-0.012173552066087723,0.0005114141386002302,-0.018635105341672897,0.01824198290705681,0.0255444273352623,-0.0282748956233263,0.004239222966134548,-0.00812776479870081,4.7788598749320954e-05,0.0557871051132679,0.019567588344216347,-0.00028773516532965004,-0.02875434421002865,-0.03580142557621002,-0.002113121096044779,-0.020758362486958504,0.05183732509613037,0.017015770077705383,0.01906605437397957,-0.03805425390601158,-0.0051781125366687775,-0.02848101407289505,-0.006052127107977867,0.033519964665174484,0.03536006063222885,0.012120080180466175,0.0025614923797547817,0.0009862167062237859,-0.03235156834125519,0.02071847766637802,0.03410404548048973,0.016081364825367928,0.011789122596383095,0.01911352388560772,0.004926277324557304,0.005005321465432644,-0.043821439146995544,-0.017150579020380974,0.0077651748433709145,0.0003986236115451902,-0.008670051582157612,-0.022377822548151016,0.011790684424340725,-0.01683042012155056,-0.00673762708902359,0.008468764834105968,0.026806943118572235,-0.0197699423879385,-0.03254053369164467,-0.03715294227004051,-0.039610929787158966,-0.004791934043169022,0.006890779361128807,0.024904610589146614,-0.025197915732860565,-0.0005258696037344635,0.012641497887670994,0.015375467017292976,0.03656463697552681,0.00463845394551754,-0.012778306379914284,-0.02092798426747322,-0.009456257335841656,-0.0372374951839447,-0.05441342294216156,0.044130802154541016,0.015424227342009544,0.044802676886320114,0.0038794628344476223,-0.024197202175855637,-0.0016400220338255167,-0.06931869685649872,-0.03873330354690552,0.014769361354410648,-0.008807665668427944,0.025098230689764023,0.00847370084375143,-0.03129679709672928,-0.03269540145993233,0.03355540335178375,0.023353222757577896,0.027102727442979813,0.008923940360546112,0.04196964204311371,0.10648612678050995,-0.01744609698653221,0.0019266846356913447,-0.04089239239692688,0.009922600351274014,-0.02765544317662716,-0.01203931588679552,-0.050821978598833084,0.008588070049881935,0.010486271232366562,0.025894107297062874,0.04791936278343201,-0.024667799472808838,-0.00992124155163765,-0.00803361926227808,0.044752370566129684,0.016711989417672157,0.013201702386140823,0.02621462382376194,0.009587633423507214,-0.022157341241836548,-0.008772636763751507,0.01040724292397499,0.004230833612382412,-0.019854040816426277,-0.05337895452976227,0.018900614231824875,0.012507457286119461,-0.0319330058991909,0.01058110874146223,-0.017747901380062103,-0.01473324280232191,-0.02729983814060688,0.033364370465278625,0.02851911075413227,0.018694497644901276,0.041170090436935425,0.028144676238298416,-0.07330892235040665,-0.03439082205295563,0.04874039068818092,0.03849935531616211,0.01481616124510765,0.01821759343147278,0.04376925528049469,0.01881401054561138,-0.005508360452950001,-0.004167346749454737,-0.0013212383491918445,-0.05223914235830307,-0.03634573146700859,0.018378322944045067,-0.0016303635202348232,0.01748119667172432,-0.01921321079134941,0.03549399599432945,-0.008009825833141804,-0.010965736582875252,-0.02458971180021763,-0.04181395098567009,-0.009720382280647755,-0.0021291307639330626,-0.05341916158795357,0.012093105353415012,-0.013677773997187614,0.07378465682268143,0.00434280838817358,-0.022366447374224663,0.00948258861899376,0.003781229257583618,-0.1555849015712738,-0.0041153645142912865,0.01299531664699316,0.009006157517433167,0.03128419816493988,-0.010516228154301643,-0.06446821987628937,0.013601542450487614,-0.006822902709245682,0.02624053880572319,0.010732783004641533,-0.05096074193716049,0.0010267082834616303,-0.0007933431770652533,0.01767350360751152,-0.009459401480853558,0.010237998329102993,-0.041718993335962296,-0.003640588838607073,-0.05284066125750542,-0.02430730126798153,-0.0174898412078619,0.06647244095802307,0.003071338403970003,-0.039079729467630386,-0.012542522512376308,-0.01507965661585331,-0.0016694598598405719,-0.03522174805402756,-0.025427043437957764,-0.041190698742866516,-0.008656288497149944,-0.0063092345371842384,0.023110253736376762,0.006343475077301264,0.05140964686870575,-0.009329622611403465,0.005937517154961824,0.024093065410852432,-0.02117406763136387,0.030527882277965546,-0.02994326502084732,0.019458932802081108,0.022885756567120552,0.03633096069097519,-0.03274504467844963,-0.025193624198436737,0.0304874274879694,-0.05045784264802933,-0.007156927138566971,0.0002632219111546874,-0.03667321428656578,0.03343961760401726,-0.000727548380382359,-0.018832417204976082,0.0076104020699858665,-0.016495658084750175,-0.0035339281894266605,-0.00010041255154646933,0.10188901424407959,-0.05503101274371147,-0.04886370897293091,0.019153127446770668,-0.0003434721438679844,-0.01879286579787731,0.0037846900522708893,-0.010261395014822483,-0.030383341014385223,0.0449259988963604,0.0151467090472579,0.038852814584970474,0.021958941593766212,-0.037593062967061996,-0.016459163278341293,0.0003842625592369586,-0.021652141585946083,-0.015943245962262154,-0.036421410739421844,-0.024624494835734367,-0.11945565044879913,-0.033100925385951996,-0.013826696202158928,0.017142070457339287,-0.013971383683383465,-0.03479816019535065,-0.05463365837931633,-0.0020317421294748783,0.02610885538160801,0.022207291796803474,0.21845991909503937,-0.02780364826321602,0.023863818496465683,-0.011493273079395294,0.08531605452299118,0.012615252286195755,-0.010676571168005466,-0.036802876740694046,-0.014996654354035854,-0.0263341274112463,-0.0040845926851034164,0.011440129019320011,-0.004952683579176664,-0.028654273599386215,-0.0062589398585259914,0.030777733772993088,0.012617946602404118,-0.03648025915026665,0.06575017422437668,0.015085623599588871,0.018838845193386078,0.024512935429811478,-0.0015220518689602613,-0.007385345175862312,0.018611734732985497,-0.028969021514058113,0.00487673282623291,0.03168795257806778,-0.017651529982686043,-0.005381002556532621,-0.017931491136550903,-0.002306448994204402,0.01627206802368164,0.013113864697515965,0.01910778507590294,-0.02273484505712986,-0.010903236456215382,-0.0049823070876300335,0.0011703984346240759,0.03453369066119194,-0.015177121385931969,-0.040049318224191666,0.01880592852830887,0.008752460591495037,0.006948732305318117,0.032821688801050186,0.0027854437939822674,-0.016814159229397774,0.002083203522488475,-0.013623842969536781,0.03191106393933296,-0.021625621244311333,-0.019676540046930313,0.015622952952980995,-0.0051697115413844585,-0.021825358271598816,-0.014015468768775463,-0.03397766873240471,-0.03862281143665314,0.03535090759396553,-0.006396847777068615,0.01572374813258648,-0.06387334316968918,0.03954891487956047,-0.006397388409823179,0.0037548078689724207,0.023829136043787003,9.457120904698968e-05,0.03977523371577263,0.03808773308992386,-0.03438703343272209,0.014624951407313347,0.001777412835508585,-0.028416862711310387,0.007620793767273426,-0.0234756451100111,-0.04015370458364487,0.039268117398023605,0.05067522078752518,-0.025800518691539764,0.0029162170831114054,-0.036653295159339905,0.006617528386414051,-0.0023436537012457848,0.048798732459545135,-0.026369046419858932,0.0008179753785952926,0.015046457760035992,0.019027266651391983,0.015989897772669792,-0.0773497074842453,0.02108943648636341,-0.009692764841020107,-0.01411244086921215,-0.05539141222834587,-0.00019587167480494827,-0.04371081665158272,-0.00780189223587513,-0.06135943904519081,-0.017464954406023026,-0.0301265437155962,-0.028353843837976456,-0.025363223627209663,-0.02946850098669529,0.00931487325578928,-0.012315673753619194,-0.03513934463262558,0.0016309469938278198,-0.01579628325998783,-0.004110914655029774,0.0027306871488690376,0.03724566474556923,0.002088683657348156,-0.02753308042883873,-0.014915152452886105,0.012392194010317326,0.03233878314495087,0.014463855884969234,0.04662397876381874,0.02207363024353981,-0.031118452548980713,-0.02729225344955921,-0.0042227343656122684,0.001124575617723167,-0.05390911549329758,-0.008073769509792328,-0.0014239713782444596,0.00010771185043267906,-0.031153246760368347,0.08069302141666412,-0.019543075934052467,-0.03459890931844711,-0.016283633187413216,0.03887354955077171,0.07352855056524277,-0.01916314661502838,0.07098814845085144,-0.0008823427488096058,0.05033054202795029,0.009257132187485695,0.01544534508138895,-0.01632613316178322,-0.0073908427730202675,0.0041620139963924885,0.00028659816598519683,-0.02209390513598919,0.004789973143488169,-0.051337771117687225,0.011900941841304302,0.007190568372607231,-0.028105808421969414,0.0337865874171257,-0.006938908249139786,-0.055526476353406906,0.022452108561992645,0.002936147153377533,0.00015098188305273652,0.02942933514714241,-0.01374303549528122,-0.03190475329756737,0.0023280722089111805,0.004387746565043926,0.017975622788071632,0.042441319674253464,0.0007961687515489757,0.031680405139923096,0.0367724671959877,0.06029003486037254,0.001455040299333632,-0.02433570846915245,-0.010561436414718628,-0.047577131539583206,-0.06454086303710938,0.015613190829753876,0.035283610224723816,0.029546108096837997,-0.023531636223196983,-0.011892357841134071,-0.008414669893682003,0.02767297439277172,0.006754468660801649,-0.007680680602788925,0.06519999355077744,-0.004525003954768181,0.008401394821703434,-0.015983067452907562,0.04275241866707802,-0.015080669894814491,0.01675167866051197,0.007849342189729214,0.02977675572037697,0.09612622857093811,-0.03471335396170616,-0.014554859139025211,-0.020872734487056732,-0.015555774793028831,-0.014786469750106335,0.017185816541314125,-0.05108167603611946,0.0021739527583122253,-0.06985857337713242,0.022304313257336617,-0.00222887028940022,0.011173094622790813,-0.017673956230282784,0.012225472368299961,-0.016644855961203575,0.03229503706097603,0.007167766336351633,0.0033094247337430716,-0.02083534374833107,-0.017056914046406746,-0.04563407227396965,-0.005314118694514036,0.00310131860896945,-0.028124401345849037,0.013000357896089554,0.022255398333072662,-0.04717923328280449,-0.02639474719762802,0.010452956892549992,-0.031058011576533318,0.04243765398859978,-0.009517954662442207,-0.02080993540585041,-0.0005526000750251114,0.023046601563692093,0.012260761111974716,-0.0019523088121786714,0.007185761816799641,0.002181322779506445,0.03151383996009827,-0.04993157088756561,-0.023618897423148155,0.021357083693146706,0.010918384417891502,-0.004538852255791426,0.06100621819496155,-0.0017870509764179587,-0.05889042094349861,0.0027137589640915394,-0.07317900657653809,-0.041735175997018814,0.08429314196109772,-0.05671488493680954,0.06442365795373917,0.0354963056743145,-0.025663673877716064,0.06414318829774857,0.05483851209282875,-0.024175375699996948,0.04028810188174248,0.002226137323305011,-0.008576133288443089,0.011495297774672508,0.0018570836400613189,0.02222803793847561,-0.0062371306121349335,0.021282950416207314,-0.029733702540397644,-0.029702357947826385,0.061734508723020554,0.003357925219461322,0.026944750919938087,-0.032651323825120926,-0.051689714193344116,0.04495692998170853,-0.046758972108364105,0.0014234259724617004,-0.0025414228439331055,-0.0486932210624218,-0.00418674573302269,-0.013157233595848083,0.006386986002326012,0.03507566824555397,0.01690962165594101,-0.021793877705931664,0.018052101135253906,-0.02032056823372841,-0.0027471340727061033,-0.016039947047829628,0.0024960834998637438,-0.04305771365761757,-0.06217969208955765,0.03233333304524422,0.014101964421570301,0.03885553404688835,0.028143204748630524,-0.014434010721743107,-0.011160621419548988,-0.010956748388707638,-0.051842521876096725,-0.0646885558962822,0.028717122972011566,-0.03722773864865303,-0.012082679197192192,-0.023010235279798508,0.0040945434011518955,-0.019186733290553093,0.018434736877679825,-0.012584713287651539,0.019905321300029755,-0.018455762416124344,-0.018555570393800735,-0.045438501983881,0.01525320578366518,0.004327711183577776,-0.09070004522800446,0.028358854353427887,0.045083608478307724,0.03717751428484917,0.024484196677803993,-0.009517953731119633,-0.009431657381355762,0.0007591199828311801,0.017409102991223335,0.06607170403003693,-0.01292390562593937,0.009375844150781631,0.01923065446317196,0.011820650659501553,0.008648121729493141,-0.04057059437036514,0.06847608834505081,-0.020203202962875366,-0.02259386144578457,-0.05245798081159592,0.020434347912669182,-0.04065997153520584,-0.06251334398984909,-0.02322198450565338,0.004597546067088842,-0.031775906682014465,-0.021978188306093216,0.009289751760661602,0.01025489903986454,0.014906561933457851,0.005595193710178137,-0.019608698785305023,0.04747878387570381,0.0006679797661490738,0.04260798543691635,0.013650446198880672,-0.02289482206106186,0.009342600591480732,0.019170006737113,-0.028037922456860542,-0.016723046079277992,0.010602147318422794,-0.0016515008173882961,0.020876746624708176,0.021600842475891113,-0.010055010206997395,-0.02209591120481491,0.051245685666799545,0.01684993878006935,-0.05305066332221031,-0.004865389317274094,0.035080794245004654,0.020746706053614616,-0.04443787783384323,0.009561375714838505,-0.06022968888282776,0.026691311970353127,-0.02212226577103138,0.006741049233824015,0.018080970272421837,-0.0005539057892747223,0.033643968403339386,-0.00415909243747592,0.001371117657981813,0.005385630764067173,-0.015839895233511925,0.015070218592882156,-0.002025729976594448,0.059577375650405884,-0.023244954645633698,-0.020561033859848976,0.02746720053255558,-0.020906876772642136,-0.001754920114763081,0.015423501841723919,0.020282695069909096,-0.03059510514140129,0.009342650882899761,-0.002001990331336856,-0.06397468596696854,-0.016133993864059448,0.039345528930425644,0.02325895056128502,-0.04873299226164818,0.010032864287495613,-0.023813521489501,0.01412157341837883,-0.15013840794563293,0.0206006970256567,-0.030519740656018257,-0.022590965032577515,-0.03461434692144394,0.02087264694273472,-0.033773887902498245,-0.06551176309585571,-0.00900537520647049,0.010553039610385895,-0.027387361973524094,0.01118522696197033,0.03152376413345337,-0.046793147921562195,0.04595666751265526,0.03732357174158096,-0.009744451381266117,-0.005071235354989767,0.005475230515003204,0.040578410029411316,2.0922398107359186e-05,-0.02326490730047226,0.042800888419151306,0.03803618997335434,-0.024454444646835327,-0.05303192138671875,0.0034539808984845877,0.05011993646621704,-0.034634049981832504,-0.03731266036629677,0.008109056390821934,-0.07372862845659256,0.03926841914653778,0.06551004201173782,-0.0016884456854313612,0.011396174319088459,0.03958761319518089,-0.028950288891792297,0.002899997169151902,0.03617142140865326,0.023285118862986565,0.028067653998732567,0.015173045918345451,0.015815529972314835,-0.006588934920728207,-0.041654907166957855,0.023007646203041077,0.014868589118123055,0.007916150614619255,0.02663443610072136,-0.00999829825013876,0.00835407618433237,-0.00020843675883952528,0.05323968827724457,0.020891036838293076,-0.003166407812386751,-0.05414595454931259,-0.006688897032290697,-0.0015168627724051476,0.05566542595624924,0.00024420907720923424,-0.02238735742866993,-0.042112432420253754,-0.06698784232139587,-0.04556874558329582,0.017894426360726357,-0.040310896933078766,0.024108150973916054,0.025999978184700012,-0.012061280198395252,-0.009200457483530045,-0.009663197211921215,-0.03138483688235283,-0.002211964223533869,0.044647179543972015,0.023203222081065178,0.027417588979005814,0.008448517881333828,-0.009476922452449799,-0.026989677920937538,-0.013745793141424656,-0.009974215179681778,-0.006622327025979757,0.038578376173973083,0.020160555839538574,0.032086264342069626,-0.003854320617392659,0.048850324004888535,-0.03679690882563591,0.0057219816371798515,-0.02013472467660904,-0.03279758617281914,-0.005566930398344994,-0.04384991154074669,-0.005179742816835642,0.009159478358924389,-0.03545248135924339,0.0075321621261537075,-0.004065976943820715,-0.01934107206761837,0.020382894203066826,-0.0008584719034843147,-0.0008569291094318032,-0.0007807754445821047,-0.007518603466451168,0.029353540390729904,-0.005292690359055996,0.01426500454545021,0.013820198364555836,-0.002452387008816004,-0.012918669730424881,-0.046238236129283905,0.00434484425932169,0.004476596135646105,-0.05840316414833069,0.029132850468158722,0.00028053982532583177,0.013025021180510521,-0.03464808687567711,0.005014083813875914,-0.0037589529529213905,0.026595911011099815,0.03855610638856888,-0.04750613868236542,-0.00877139251679182,-0.004393431358039379,0.053048375993967056,0.03228847682476044,-0.029813574627041817,-0.007241407409310341,0.04123177006840706,-0.016475485637784004,0.003159452462568879,0.04989185929298401,0.007689014542847872,-0.015696948394179344,-0.006765330210328102,0.04697233438491821,-0.007351558189839125,0.012446551583707333,-0.007458018604665995,-0.006826048716902733,0.023742282763123512,-0.01563541777431965,-0.03223681449890137,0.008433869108557701,-0.044248830527067184,-0.002161342417821288,-0.06325572729110718,-0.01196405477821827,0.022096144035458565,-0.0231863334774971,-0.025602921843528748,0.060683321207761765,-0.05777692422270775,0.05511962249875069,-0.024466678500175476,0.024175086989998817,0.02553471177816391,0.019947540014982224,-0.04073907434940338,-0.028768563643097878,-0.025981882587075233,-0.012215648777782917,-0.01380565483123064,-0.01764128915965557,0.010345992632210255,-0.0008497639209963381,-0.03824533149600029,-0.003192206844687462,-0.016891472041606903,0.011801679618656635,-0.01573183946311474,0.02528231032192707,0.013951204717159271,-0.0830749049782753,0.02304237149655819,0.005945422686636448,0.08387743681669235,0.0021430361084640026,0.015207139775156975,-0.015361592173576355,0.012571867555379868,0.006508325692266226,0.04382672533392906,0.040645040571689606,-0.020613893866539,0.04337363690137863,0.007515987381339073,0.0527033694088459,0.026706496253609657,0.028836559504270554,0.04965084418654442,-0.0281118992716074,0.0543968603014946,0.054192300885915756,-0.023229757323861122,0.0430452786386013,-0.01894526183605194,0.010333853773772717,-0.040242280811071396,0.024844098836183548,-0.020945783704519272,-0.011371318250894547,-0.01287319790571928,-0.01366319041699171,-0.002420879667624831,-0.005416229832917452,-0.0484641008079052,0.007767138537019491,0.009371640160679817,-0.008116692304611206,0.02182227000594139,0.04527978599071503,-0.0007171550532802939,0.0002759904891718179,-0.027400778606534004,0.01034535001963377,-0.029638037085533142,0.04628844931721687,0.01131171640008688,0.011546695604920387,-0.06597190350294113,0.03318529948592186,-0.030854588374495506,-0.015634773299098015,-0.03665293753147125,-0.033912889659404755,0.014279810711741447,-0.031054912135004997,0.021645866334438324,0.014051077887415886,-0.005874996539205313,0.020198483020067215,0.045445170253515244,0.012097031809389591,0.02301936224102974,-0.03352238982915878,0.02399611286818981,-0.04141134396195412,0.038192395120859146,-0.003725903807207942,0.06473561376333237,-0.007683128118515015],"k":600,"num_candidates":800,"_name":"knn_query"}}],"minimum_should_match":1}}],"filter":[{"term":{"platform_sku_trader":true}},{"term":{"platform_rule_trader":true}},{"bool":{"should":[{"bool":{"must_not":{"exists":{"field":"trader_buyer_ids"}}}},{"term":{"trader_buyer_ids":12883}}]}},{"terms":{"status":[2,4,5]}}]}},"functions":[{"filter":{"term":{"label_id_list":156}},"weight":1.14},{"filter":{"term":{"label_id_list":157}},"weight":1.13},{"filter":{"term":{"label_id_list":158}},"weight":1.1},{"filter":{"term":{"label_id_list":159}},"weight":1.1},{"filter":{"term":{"label_id_list":162}},"weight":1.05},{"filter":{"term":{"label_id_list":163}},"weight":1.1},{"filter":{"term":{"label_id_list":164}},"weight":1.13},{"filter":{"term":{"label_id_list":165}},"weight":1.15},{"field_value_factor":{"field":"on_sell_days_boost","missing":1.0}},{"filter":{"term":{"is_video":true}},"weight":1.2}],"score_mode":"max","boost_mode":"multiply"}},"track_scores":true,"collapse":{"field":"goods_id"},"aggs":{"unique_count":{"cardinality":{"field":"goods_id"}}}} - - -2025-06-28 15:07:36,526 - INFO - [REQ: 0 UID: -1] TIMING: QA=113ms, queryEncoding=0ms, userProfile=0ms, ES=20945ms, BgeReranking=1974ms, BizReranking=9ms, Reranking=1987ms, total=23079ms, sku_id_list_filling=23ms -```bash -{"size": 1000, "from": 0, "_source": {"includes": ["name_zh", "is_star", "category_name_zh", "sub_name_zh", "label_id_list", "is_video", "brand_id", "category_id", "sale_category_all", "price_range", "on_sell_days_boost", "brand_name_zh", "supplier_name"]}, "query": {"function_score": {"query": {"bool": {"must": [{"bool": {"should": [{"multi_match": {"query": "新款拉布布6寸搪胶PVC卡头袋6款混装", "fields": ["name_zh^2.0", "goods_keyword_zh^1.0", "category_name_zh^1.0", "sale_category_keyword_zh^1.0", "sub_name_zh^1.0"], "minimum_should_match": "66%", "tie_breaker": 0.3, "_name": "base_query"}}, {"knn": {"field": "embedding_name_zh", "query_vector": [0.04777948185801506, -0.009930620901286602, -0.03340917453169823, -0.010704109445214272, -0.0495409220457077, 0.014086474664509296, 0.0036832967307418585, -0.013905951753258705, -0.00912229623645544, -0.02091393806040287, 0.005698441993445158, 0.01829547993838787, -0.017833806574344635, 0.04031107947230339, 0.031932197511196136, 0.01550996769219637, -0.03871632367372513, -0.0013923225924372673, 0.014080504886806011, -0.02680817060172558, -0.010332519188523293, 0.002413432113826275, -0.03353426605463028, 0.026190491393208504, 0.043260280042886734, 0.033913154155015945, -0.021475736051797867, 0.007874957285821438, -0.032225947827100754, -0.007520684506744146, 0.008848990313708782, 0.039138346910476685, 0.002573886653408408, -0.04758479446172714, -0.008340752683579922, -0.049250971525907516, 0.00864164624363184, 0.035917505621910095, -0.05339735001325607, 0.03549637272953987, -0.00036399468081071973, 0.012647312134504318, 0.05966982990503311, 0.005590304732322693, 0.04215541109442711, -0.009710724465548992, -0.013751043006777763, -0.010458292439579964, -0.01092573907226324, -0.031235473230481148, 0.03520767390727997, -0.02142075076699257, 0.05230945721268654, -0.08563978224992752, 0.005584254860877991, 0.025608506053686142, -0.005313157569617033, -0.05565866827964783, -0.04408181831240654, -0.04115551337599754, -0.03133457154035568, 0.0035521043464541435, 0.010418717749416828, 0.008755940943956375, -0.014455541968345642, 0.0792229026556015, -0.0006479261792264879, 0.026836542412638664, -0.0099220871925354, -0.04345971718430519, -0.03007948026061058, 0.012955267913639545, -0.0005541691207326949, -0.009107008576393127, -0.06151101365685463, 0.002716085407882929, 0.05793072283267975, 0.018348004668951035, -0.010979007929563522, 0.021718094125390053, 0.0311488825827837, 0.01106400229036808, -0.01580420695245266, -0.009378353133797646, 0.018424641340970993, 0.0033540285658091307, -0.05074841156601906, -0.018410172313451767, -0.06399434059858322, 0.008303754962980747, 0.0008616647101007402, 0.01031291764229536, 0.0024627535603940487, -0.02586234174668789, 0.0064286766573786736, 0.055150166153907776, -0.005198394414037466, -0.02913581021130085, 0.02242407575249672, -0.0035910012666136026, -0.0044089690782129765, 0.06864335387945175, 0.040900155901908875, 0.014038962312042713, -0.01387964840978384, -0.048606064170598984, 0.0013360632583498955, -0.0005932460771873593, 0.0003368504985701293, -0.024940822273492813, 0.008088236674666405, 0.04601464793086052, 0.010241185314953327, 0.004739545285701752, 0.03083225153386593, -0.0336325578391552, -0.015431303530931473, -0.04710129648447037, 0.01660567708313465, 0.010237863287329674, 0.025120045989751816, -0.005079660564661026, 0.04518229514360428, -0.028497137129306793, 0.008398430421948433, -0.049911994487047195, -0.026090597733855247, 0.008263975381851196, -0.011193313635885715, 0.005899224430322647, 0.02586648240685463, -0.01744774542748928, -0.05286448821425438, -0.0037355232052505016, -0.020177341997623444, -0.00937901996076107, 0.004217286594212055, -0.024037707597017288, -0.008115537464618683, -0.02264280430972576, -0.0010051490971818566, 0.07857394218444824, -0.019911985844373703, -0.009416090324521065, 0.004931884352117777, -0.022695835679769516, 0.05615118518471718, 0.01858239434659481, 0.026104934513568878, -0.032858431339263916, 0.0020107044838368893, 0.019154125824570656, 0.01621229574084282, 0.03562867268919945, 0.03500063717365265, -0.04617758095264435, 0.01572221703827381, 0.05247366428375244, -0.023827500641345978, 0.04365061968564987, 0.0006273780600167811, 0.03074229694902897, -0.02591243013739586, -0.03805765137076378, -0.015149170532822609, 0.03779711201786995, 0.02580627053976059, 0.030128315091133118, -0.011303736828267574, 0.03516492247581482, 0.026869751513004303, -0.02845270186662674, 0.059881582856178284, 0.003097916953265667, 0.04811083525419235, 0.003229842521250248, 0.054461948573589325, -0.013254344463348389, 0.023268887773156166, -0.07977989315986633, -0.019608188420534134, 0.038743309676647186, 0.021014267578721046, -0.03317583352327347, -0.030563242733478546, 0.012792572379112244, 0.006061076652258635, -0.027493035420775414, 0.014338426291942596, 0.017754076048731804, 0.004996004980057478, -0.029846904799342155, 0.03648756444454193, -0.038578759878873825, 0.02735607512295246, 0.04637077450752258, -0.032901331782341, 0.010212377645075321, -0.009683933109045029, 0.002401115372776985, 0.015017108991742134, 0.004918758757412434, 0.011426692828536034, 0.006396048236638308, -0.048814959824085236, 0.002921796403825283, 0.019042879343032837, 0.015430758707225323, 0.03393460437655449, -0.04169744253158569, -0.017125923186540604, 0.05922950804233551, 0.008733823895454407, -0.019725129008293152, -0.047633539885282516, -0.0011968417093157768, 0.006019105203449726, 0.014745817519724369, -0.020885944366455078, 0.027048124000430107, -0.04038321226835251, 0.035100437700748444, -0.019358128309249878, 0.06470426172018051, -0.018287939950823784, -0.030778348445892334, -0.03218177706003189, 0.0794251337647438, 0.02252604067325592, -0.026251694187521935, 0.003392222337424755, 0.025379657745361328, -0.012761044315993786, -0.03338577225804329, -0.05206181854009628, 0.01462528109550476, -0.034688081592321396, 0.019273769110441208, 0.0273684561252594, 0.018803877755999565, -0.045315977185964584, -0.03252853825688362, 0.0229090116918087, 0.03802607208490372, -0.0030987553764134645, 0.035308338701725006, -0.0042693340219557285, 0.053714025765657425, -0.021115798503160477, -0.03247977793216705, 0.014298364520072937, 0.021359127014875412, -0.05025552585721016, -0.058426227420568466, -0.028225066140294075, -0.008211921900510788, 0.041396282613277435, -0.0175744891166687, -0.03840591385960579, 0.010588625445961952, -0.011450069956481457, 0.04409050568938255, 0.027623001486063004, 0.006111210212111473, 0.03232325240969658, 0.01910562254488468, -0.013157332316040993, 0.014519988559186459, 0.014888674952089787, -0.025160839781165123, -0.0019194727065041661, -0.009782499633729458, -0.007831890136003494, -0.01422909740358591, -0.06268665194511414, 0.036630041897296906, -0.057012889534235, -0.027425779029726982, 0.051897820085287094, 0.00182741426397115, 0.03560733422636986, 0.025675274431705475, -0.012190687470138073, -0.0068927849642932415, 0.03648059442639351, -0.018904387950897217, -0.04686117172241211, -0.011108235456049442, 0.018694736063480377, -0.012015921995043755, 0.02588983066380024, 0.021791545674204826, 0.0568043552339077, -0.01771237701177597, -0.036844413727521896, 0.03542793542146683, 0.017389442771673203, -0.13236093521118164, 0.005069363862276077, -0.04356488585472107, 0.01762949861586094, 0.0036568883806467056, 0.0357181541621685, -0.04984300583600998, 0.004781763534992933, -0.023634064942598343, -0.006006993819028139, 0.022758550941944122, -0.05710079148411751, 0.025989431887865067, 0.007507902104407549, 0.004580166190862656, -0.027463912963867188, -0.02052846923470497, 0.01266541238874197, 0.0032631719950586557, -0.01589594967663288, -0.019410576671361923, -0.042919766157865524, 0.06982193142175674, -0.01324536558240652, -0.021568164229393005, -0.016236338764429092, 0.023161690682172775, -0.009671044535934925, 0.03011992573738098, -0.04479934275150299, 0.031769800931215286, 0.07410213351249695, 0.004593612626194954, 0.012650864198803902, 0.032900370657444, 0.04676395654678345, -0.005481184460222721, 0.03707682713866234, -0.0343339703977108, 0.014170031994581223, 0.0037862148601561785, 0.005158451851457357, 0.03605901822447777, 0.012319646775722504, 0.02190830372273922, -0.03371215984225273, 0.0013277997495606542, 0.015922417864203453, -0.03311590105295181, -0.02045893669128418, 0.0022150904405862093, 0.024235514923930168, 0.05243319272994995, -0.06884219497442245, -0.032121241092681885, -0.02057197317481041, 0.02464400604367256, 0.023941263556480408, 0.008417989127337933, 0.028591185808181763, -0.03475973382592201, -0.10133542120456696, 0.030981674790382385, -0.0059692696668207645, -0.02728826366364956, 0.018892623484134674, 0.017253372818231583, -0.010950181633234024, 0.010115663520991802, -0.04097826033830643, 0.047668490558862686, 0.005775030702352524, -0.0330018550157547, -0.015302733518183231, -0.026839636266231537, 0.03990592807531357, -0.08095647394657135, -0.010236202739179134, -0.023906735703349113, -0.11363940685987473, -0.02794370800256729, -0.007577626965939999, -0.010191259905695915, -0.031102292239665985, -0.005952379200607538, -0.015238235704600811, 0.021037837490439415, 0.048086635768413544, 0.02485371194779873, 0.2202252894639969, 0.006417000666260719, -0.01582985185086727, -0.020443500950932503, 0.049587927758693695, -0.010321233421564102, -0.019389592111110687, -0.0219429899007082, -0.013874799944460392, -0.021901890635490417, -0.04813386872410774, 0.054123375564813614, 0.0005942619172856212, -0.034767698496580124, -0.008833615109324455, 0.025376304984092712, -0.00027705455431714654, -0.018086474388837814, 0.06567089259624481, 0.02201266773045063, 0.009660826064646244, -0.050511252135038376, -0.009195378981530666, -0.02317940630018711, -0.03656037524342537, -0.030937548726797104, -0.004057656973600388, 0.01446757186204195, -0.0033005152363330126, 0.05119867995381355, -0.0002796838525682688, 0.004812772385776043, -0.01656021922826767, -0.033608417958021164, -0.00369013543240726, -0.04403204470872879, -0.009051754139363766, 0.00161420414224267, -0.006753283087164164, 0.04965002462267876, -0.03266602382063866, -0.031390659511089325, 0.012554764747619629, 0.0403885543346405, -0.008178787305951118, -0.0088236965239048, 0.01938529685139656, 0.022512517869472504, 0.01890033483505249, 0.004583593457937241, -0.018219444900751114, -0.03660663217306137, -0.05960412696003914, 0.018526002764701843, 0.008329992182552814, -0.03104996681213379, -0.0039648874662816525, -0.026751268655061722, -0.006567014381289482, 0.06237832084298134, 0.021959850564599037, 0.008299740962684155, -0.05067161098122597, 0.019776970148086548, -0.03001045435667038, 0.03048914484679699, 0.0013995312619954348, -0.0014632665552198887, -0.008871791884303093, 0.014849912375211716, 0.031150512397289276, 0.044207923114299774, 0.03997069597244263, -0.026292748749256134, 0.06572143733501434, -0.015270156785845757, 0.02528577856719494, 0.024951178580522537, 0.04410326108336449, 0.019941337406635284, -0.04207945242524147, 0.02629714272916317, -0.050845757126808167, 0.006399694364517927, 0.003688838565722108, -0.027066392824053764, 0.03403649106621742, 0.014691866934299469, -0.013028793036937714, -0.02166789583861828, -0.03168860450387001, -0.004749130457639694, -0.03046979196369648, -0.04633525758981705, -0.025907719507813454, -0.020302731543779373, 0.015615634620189667, -0.006162186618894339, -0.02793055586516857, -0.007741870824247599, 0.004227485507726669, -0.03796316310763359, 0.012767232023179531, -0.032471198588609695, -0.023150276392698288, 0.014846229925751686, -0.029468009248375893, -0.031153546646237373, 0.013394993729889393, -0.001276634749956429, 0.037979044020175934, 0.03422647342085838, -6.681141530862078e-05, -0.023563414812088013, -0.007209332659840584, -0.028135180473327637, -0.009307583793997765, 0.0011493850033730268, 0.03275229036808014, -0.0026970740873366594, -0.010681141167879105, -0.006956904660910368, 0.005157421343028545, -0.013205036520957947, -0.012163165956735611, -0.06095128506422043, -0.020321063697338104, -0.0014993196818977594, -0.03912986442446709, 0.030664371326565742, 0.006285347510129213, -0.03537425026297569, 0.0011132827494293451, -0.002627303823828697, -0.02077833004295826, -0.05684716999530792, 0.02123040333390236, 0.004172665998339653, 0.010015258565545082, 0.044045340269804, -0.01734968088567257, -0.05638998746871948, -0.03383277729153633, 0.0023396736942231655, 0.003095283405855298, -0.01121941115707159, -0.007378653157502413, -0.043002281337976456, 0.005443307105451822, 0.059094544500112534, 0.011385264806449413, 0.0419551320374012, 0.042968254536390305, -0.0774039775133133, -0.00788707472383976, -0.02445562370121479, -0.01815369911491871, 0.025737736374139786, -0.027459727600216866, -0.014745943248271942, 0.007133605889976025, -0.016498398035764694, 0.027850404381752014, 0.02756435237824917, -0.011284667067229748, 0.029066434130072594, -0.03676832839846611, 0.03978204354643822, -0.0025798329152166843, -0.020186856389045715, 0.0056440820917487144, -0.03432284668087959, -0.03640623018145561, -0.014417240396142006, 0.04473884031176567, 0.013192025013267994, 0.04739168658852577, -0.034630272537469864, -0.030753694474697113, 0.014856823720037937, 0.02894255891442299, -0.009841032326221466, -0.009405701421201229, 0.005677532404661179, -0.0051913075149059296, 0.01481472048908472, -0.026325812563300133, -0.008713497780263424, 0.012898151762783527, 0.00781390629708767, -0.03967709466814995, 0.05917689576745033, -0.02620290033519268, 0.00016539564239792526, -0.007338281720876694, -0.023503435775637627, -0.008488921448588371, -0.007586051244288683, -0.025655874982476234, -0.03180738165974617, -9.595941082807258e-05, -0.0014381863875314593, 0.03718188405036926, -0.04928509145975113, -0.004411920439451933, -0.003151774639263749, -0.028855348005890846, 0.04923743009567261, 0.013488849624991417, -0.05147544667124748, 0.043314557522535324, -0.014842656441032887, 0.022192806005477905, -0.0020392360165715218, -0.035835329443216324, 0.03502439334988594, 0.009316188283264637, 0.03170185163617134, -0.09451442211866379, -0.003776612924411893, -0.022116290405392647, -0.0037039185408502817, 0.03516470268368721, 0.019655559211969376, 0.020455220714211464, 0.013385603204369545, 0.011516926810145378, -0.059251200407743454, -0.011112687177956104, -0.003960699774324894, 0.0020073282066732645, 0.033514946699142456, -0.017258314415812492, 0.0032192098442465067, -0.0056349909864366055, 0.007177143823355436, 0.012908353470265865, 0.027367528527975082, -0.019316252321004868, -0.006990907248109579, 0.013136813417077065, 0.029212450608611107, -0.016587860882282257, 0.0742068886756897, -0.0253263209015131, 0.056160278618335724, -0.04185504838824272, -0.027046799659729004, 0.08385784924030304, 0.012786808423697948, 0.03263417258858681, 0.00393373379483819, 0.009683518670499325, -0.03565293550491333, 0.0032062623649835587, -0.047266602516174316, -0.019129816442728043, 0.008513612672686577, 0.014801079407334328, -0.006046884693205357, -0.028829116374254227, 0.05553624406456947, -0.045485176146030426, 0.012523164041340351, -0.005150144454091787, -0.07684548199176788, 0.061715416610240936, -0.0598946288228035, 0.005060529336333275, -0.028888961300253868, -0.0338757187128067, -0.003549030050635338, -0.009436641819775105, 0.006171475164592266, 0.04165922850370407, -0.01835727132856846, 0.0071646119467914104, -0.007417601998895407, 0.03760436922311783, 0.022616975009441376, -0.032044071704149246, -0.02622726745903492, 0.030637577176094055, 0.03051326982676983, 0.021725120022892952, -0.04843033477663994, 0.012934836558997631, 0.039799466729164124, 0.008545289747416973, -0.03943444788455963, 0.022497834637761116, 0.007327898871153593, -0.019910702481865883, 0.031814564019441605, -0.007273372728377581, 0.015735039487481117, 0.010907175950706005, 0.03955914080142975, -0.025769470259547234, -0.005889975931495428, 0.0005858503864146769, 0.014834903180599213, -0.03149813413619995, -0.04521970823407173, -0.006687577348202467, -0.026763979345560074, -0.00509474566206336, -0.031613316386938095, -0.0020705198403447866, 0.019639665260910988, 0.008036686107516289, -0.03357526287436485, 0.0050591048784554005, 0.0235908180475235, 0.04358188807964325, -0.012675202451646328, 0.054179996252059937, -0.03303862363100052, 0.01800481230020523, 0.013439487665891647, -0.0331696942448616, -0.006646042224019766, -0.008015387691557407, 0.02479076199233532, 0.01766308583319187, 0.0047085764817893505, -0.011375757865607738, -0.022349664941430092, 0.003323541721329093, -0.03494121879339218, 0.013091305270791054, 0.028886917978525162, -0.005134818144142628, -0.02668473683297634, 0.04115688055753708, 0.030776608735322952, 0.036811713129282, 0.005347450263798237, 0.030731532722711563, -0.018174750730395317, -0.07439709454774857, 0.0007084792596288025, 0.026525957509875298, -0.014472294598817825, 0.01803109236061573, -0.008008803240954876, -0.008096081204712391, 0.0016154551412910223, 0.009521991945803165, -0.008798073045909405, -0.02784651331603527, 0.02028413861989975, -0.030358843505382538, -0.03808901458978653, 0.028802677989006042, 0.004689248278737068, -0.014882923103868961, 0.03565177321434021, 2.2172058379510418e-05, 0.002019741339609027, -0.025061428546905518, 0.015963824465870857, -0.0025464214850217104, -0.011338664218783379, -0.03938833624124527, 0.03270866349339485, 0.013487349264323711, -0.01151502039283514, 0.03501705080270767, -0.029465090483427048, 0.008064762689173222, -0.042369548231363297, -0.024592360481619835, 0.039809320122003555, 0.03941027447581291, -0.0028148856945335865, 0.009110087528824806, 0.0026326305232942104, -0.019704431295394897, 0.026456378400325775, -0.02716045267879963, -0.001671018311753869, 0.004271715879440308, -0.01659168303012848, 0.06367179751396179, 0.0019519432680681348, -0.028779685497283936, -0.00702137965708971, 0.004163833335042, 0.008933528326451778, -0.007324162870645523, 0.007078149821609259, -0.006141898687928915, 0.04244047775864601, -0.13298696279525757, 0.012966402806341648, -0.03154488280415535, -0.03700488805770874, -0.018856942653656006, -0.012444576248526573, -0.005103344563394785, -0.03948184475302696, -0.028914108872413635, -0.0072982837446033955, -0.02986934594810009, -0.028557509183883667, 0.09025005251169205, -0.026758549734950066, -0.006023159250617027, 0.05640563741326332, -0.005632275715470314, -0.01717621274292469, 0.014517580159008503, 0.0454145222902298, 0.011968364007771015, -1.3410058272711467e-05, 0.05054366961121559, 0.0033770177979022264, -0.035783667117357254, -0.0318947471678257, 0.038639068603515625, -0.005597645882517099, -0.04365755617618561, -0.02643357217311859, -0.004100318998098373, -0.05701404809951782, 0.036614082753658295, 0.07144607603549957, 0.00420637521892786, -0.04369935020804405, 0.026639623567461967, -0.03725285455584526, 0.011092692613601685, -0.017785832285881042, 0.014629203826189041, -0.010082025080919266, 0.008299797773361206, 0.013835153542459011, 0.030219702050089836, 0.02464393712580204, 0.032783590257167816, 0.015998510643839836, -0.008723448030650616, 0.020838847383856773, 0.02846018224954605, 0.02805771864950657, -0.021776167675852776, -0.0016920430352911353, 0.06633155792951584, -0.019061263650655746, -0.0328797809779644, -0.028227362781763077, 0.05113675445318222, 0.06641838699579239, -0.05942663550376892, 0.0312500074505806, -0.04965898394584656, -0.07419794797897339, -0.0277184396982193, -0.02882068231701851, -0.024945655837655067, 0.005923386663198471, 0.011076993308961391, 0.027987975627183914, -0.02077493630349636, -0.028385980054736137, -0.030823830515146255, 0.008996518328785896, -0.002466692356392741, -0.0020947083830833435, 0.01321386732161045, -0.011298672296106815, -0.012045539915561676, -0.024114659056067467, 0.002305290661752224, 0.012567861005663872, 0.0001450990530429408, -0.013723531737923622, -0.028525030240416527, -0.024195358157157898, -0.016579115763306618, 0.013486876152455807, -0.05165085941553116, 0.005675381049513817, -0.06880886107683182, -0.012922380119562149, -0.015354347415268421, -0.0025346409529447556, 0.012384090572595596, 0.04576214775443077, -0.001901125768199563, 0.022474762052297592, -0.03674108907580376, 0.0009729872108437121, -0.0008665743516758084, -0.03519943729043007, -0.03061450831592083, 0.051718953996896744, 0.024544652551412582, -0.005045407917350531, -0.003099393332377076, -0.036030903458595276, -0.00561000918969512, 0.017606595531105995, -0.027757544070482254, 0.022533517330884933, -0.0341557078063488, 0.028968194499611855, -0.012559563852846622, -0.013012143783271313, -0.009422944858670235, 0.020035695284605026, -0.034719012677669525, -0.00832070130854845, 0.02455293759703636, -0.00452392315492034, 0.02556878700852394, -0.01182394940406084, -0.03588307648897171, -0.031479790806770325, 0.02734064869582653, -0.01209928747266531, -0.02146436646580696, 0.015257798135280609, 0.03879304602742195, -0.0029163069557398558, -0.013043739832937717, 0.0381423719227314, -0.023813871666789055, 0.0028275649528950453, -0.03091074712574482, 0.05272400751709938, -0.019261367619037628, -0.014952140860259533, -0.011153286322951317, 0.000254094076808542, -0.028622997924685478, -0.023533131927251816, 0.008362245745956898, -0.0020938331726938486, -0.030148902907967567, 0.014103627763688564, -0.08394484221935272, -0.04881484806537628, -0.0023162513971328735, -0.02025669626891613, 0.005037359427660704, 0.026365777477622032, -0.04714160040020943, -0.026581356301903725, 0.011109788902103901, -0.01296536810696125, 0.006858957465738058, 0.048172395676374435, -0.020886855199933052, -0.01881789229810238, -0.019760163500905037, 0.05811499431729317, -0.009254585951566696, 0.05162379890680313, -0.006809046491980553, -0.007441614754498005, -0.05994577705860138, -0.025426752865314484, -0.0033068074844777584, 0.04109293967485428, -0.04208334535360336, 0.018692992627620697, 0.007629444357007742, -0.033140428364276886, -0.02147962525486946, 0.0001421299675712362, 0.06099719926714897, -0.015410018153488636, 0.018314551562070847, 0.02164696529507637, 0.0053083403035998344, 0.03678344935178757, 0.021801859140396118, 0.038568999618291855, -0.037796493619680405, 0.03040582500398159, -0.003390856087207794, 0.04997026175260544, 0.016475005075335503, -0.015403793193399906, 0.028834087774157524, -0.011071411892771721, 0.033636901527643204, -0.0040565612725913525, -0.03536051884293556, 0.027958054095506668, 0.011154691688716412, 0.06971411406993866, -0.025246834382414818, 0.003079240908846259, -0.022101325914263725, -0.01735907606780529, -0.07825532555580139, 0.0024802186526358128, 0.038880981504917145, -0.011109908111393452, 0.03661657124757767, 0.06753414124250412, -0.005024592392146587, 0.0290799792855978, 0.02365652285516262, -0.0006422005826607347, 0.009236408397555351, -0.0036766263656318188, -0.011293289251625538, 0.013936956413090229, 0.013035985641181469, 0.06735581159591675, 0.010661225765943527, 0.023256629705429077, -0.06919150054454803, -0.020434653386473656, -0.01039141695946455, 0.026040272787213326, 0.023702194914221764, -0.014527097344398499, 0.0451965257525444, -0.009080816991627216, -0.021777639165520668, 0.03533657640218735, -0.019043998792767525, 0.042686719447374344, -0.023972440510988235, 0.008945107460021973, 0.0012297232169657946, -0.0024631342384964228, -0.05636504665017128, -0.04025499150156975, 0.006564184091985226, 0.025477567687630653, 0.028906654566526413, 0.03157368674874306], "k": 600, "num_candidates": 800, "_name": "knn_query"}}], "minimum_should_match": 1}}], "filter": [{"bool": {"should": [{"bool": {"must_not": {"exists": {"field": "auth_level_list"}}}}, {"term": {"auth_level_list": "1"}}]}}, {"terms": {"status": [2, 4, 5]}}]}}, "functions": [{"filter": {"term": {"label_id_list": 156}}, "weight": 1.14}, {"filter": {"term": {"label_id_list": 157}}, "weight": 1.13}, {"filter": {"term": {"label_id_list": 158}}, "weight": 1.1}, {"filter": {"term": {"label_id_list": 159}}, "weight": 1.1}, {"filter": {"term": {"label_id_list": 162}}, "weight": 1.05}, {"filter": {"term": {"label_id_list": 163}}, "weight": 1.1}, {"filter": {"term": {"label_id_list": 164}}, "weight": 1.13}, {"filter": {"term": {"label_id_list": 165}}, "weight": 1.15}, {"field_value_factor": {"field": "on_sell_days_boost", "missing": 1.0}}, {"filter": {"term": {"is_video": true}}, "weight": 1.2}], "score_mode": "max", "boost_mode": "multiply"}}, "track_scores": true, "collapse": {"field": "goods_id"}, "aggs": {"unique_count": {"cardinality": {"field": "goods_id"}}}} -``` - -### 1k线上搜索词测试 -自己批量测试的1000条 只有一条超过1S、但是这一条耗时16S -但是这一千条请求,只填充 搜索词、搜索类型、platform几个参数,所以和线上的请求是有些差异的(没有携带各种业务过滤参数和聚合参数) - -2025-06-29 22:25:33,402 - INFO - [REQ: 7277635141262495 UID: 10031] TIMING: QA=81ms, queryEncoding=26ms, userProfile=0ms, ES=15532ms, BgeReranking=101ms, BizReranking=1ms, Reranking=103ms, total=15857ms, sku_id_list_filling=135ms - -{"keyword":"мяч баскетбольный","kt":"kwd","page":1,"size":100,"request_id":7277635141262495,"extra":{"userId":10031,"businessPlatform":"essaone"}} - -{"size":1000,"from":0,"_source":{"includes":["name_zh","is_star","category_name_zh","sub_name_zh","label_id_list","is_video","brand_id","category_id","sale_category_all","price_range","on_sell_days_boost","ru_name"]},"query":{"function_score":{"query":{"bool":{"must":[{"bool":{"should":[{"multi_match":{"query":"мяч баскетбольный","fields":["name_ru^2.0","goods_keyword_ru^1.0","category_name_ru^1.0","sale_category_keyword_ru^1.0","sub_name_ru^1.0"],"minimum_should_match":"66%","tie_breaker":0.3,"_name":"base_query"}},{"knn":{"field":"embedding_name_ru","query_vector":[0.04289894551038742,0.00985910277813673,-0.034268300980329514,0.009927251376211643,-0.02506730891764164,-0.0022724864538758993,0.021023470908403397,0.012512089684605598,-0.007213256787508726,-0.0155626330524683,0.016968950629234314,0.020527228713035583,-0.004494381137192249,0.006936016958206892,0.05834418907761574,-0.043358560651540756,0.021265869960188866,0.00786946713924408,0.02343875914812088,-0.020097509026527405,0.004428471438586712,0.022987786680459976,-0.016837123781442642,0.04001355543732643,0.030128901824355125,-0.020526576787233353,0.0048284707590937614,-0.022848233580589294,-0.017915409058332443,-0.041308656334877014,0.009778021834790707,0.026508575305342674,0.027255931869149208,-0.06618311256170273,-0.04006540775299072,-0.012760354205965996,-0.024845384061336517,-0.027004633098840714,-0.033771444112062454,0.07863473892211914,0.02332051284611225,0.02499188855290413,0.012305475771427155,-0.01007290929555893,0.011017706245183945,-0.003604582278057933,0.04882559925317764,-0.024600690230727196,-0.03751907870173454,-3.09971728711389e-05,-0.04446076974272728,-0.0007124604308046401,0.030276477336883545,-0.012156338430941105,0.02764788269996643,0.011158520355820656,0.008210097439587116,0.003985962830483913,-0.06906936317682266,-0.051149141043424606,-0.02866356074810028,-0.0184809397906065,-0.028303569182753563,0.03160034120082855,0.022804316133260727,0.1030687764286995,0.01340210996568203,0.04044792428612709,-0.0006951108807697892,-0.03142579644918442,-0.030528396368026733,0.020310457795858383,-0.035197384655475616,-0.011375757865607738,-0.0371801033616066,0.03825085982680321,0.027344614267349243,-0.023387355729937553,0.0035810910630971193,-0.0404377281665802,0.028862103819847107,-0.030622778460383415,-0.005130908451974392,0.0004950390430167317,-0.03380196914076805,-2.6819625418283977e-05,-0.014891029335558414,0.017194019630551338,-0.012086699716746807,0.027236061170697212,0.032185476273298264,0.007620120886713266,0.003946945071220398,-0.04464099556207657,-0.016398096457123756,0.0005007923464290798,-0.0005411605816334486,-0.02517220750451088,0.03179505467414856,0.0023020475637167692,0.026991689577698708,0.01480980683118105,-0.04185989126563072,0.005089135374873877,-0.02230026386678219,-0.023846641182899475,0.05685099959373474,0.03465936705470085,0.04211190342903137,0.012890998274087906,0.020012883469462395,0.02514079585671425,-0.014575435779988766,0.01421177014708519,-0.005020988639444113,-0.008809729479253292,-0.03311064466834068,0.02610122039914131,0.026517897844314575,0.017540642991662025,0.03247521445155144,-0.02376544289290905,0.03210864216089249,-0.012699628248810768,-0.016704458743333817,-0.020560186356306076,-0.027206994593143463,-0.007998860441148281,-0.012488827109336853,0.0028613281901925802,-0.005140387453138828,0.013065056875348091,-0.003555877134203911,0.007852277718484402,0.015593836084008217,-0.020180784165859222,0.012655628845095634,0.0064012156799435616,0.003723553381860256,-0.04542943835258484,0.030493926256895065,0.06474622339010239,0.02494131214916706,-0.01618345081806183,0.036915525794029236,-0.015264385379850864,0.05034146457910538,-0.008880356326699257,-0.03250479698181152,-0.0337035246193409,0.01335368026047945,0.0019932782743126154,0.03383878618478775,-0.0009181809145957232,-0.007260815240442753,-0.024388810619711876,-0.00827742274850607,0.018284207209944725,-0.0076889232732355595,0.027997937053442,-0.04451410472393036,0.017110131680965424,0.0067266616970300674,0.022615449503064156,0.001863282872363925,-0.03363585099577904,0.029225816950201988,0.025952380150556564,-0.02188272960484028,-0.022404778748750687,0.014182472601532936,-0.06488898396492004,0.0369846448302269,0.04153203219175339,0.02505381405353546,0.008598348125815392,0.04731282591819763,0.015534567646682262,0.00785487238317728,-0.03959432244300842,-0.014267205260694027,-0.01032619271427393,-0.03399171680212021,-0.013300612568855286,-0.06303181499242783,0.048246119171381,0.00110131676774472,0.015134270302951336,-7.183223351603374e-05,0.002462011529132724,-0.05770685896277428,-0.01607060804963112,0.02726883254945278,-0.03249555826187134,0.04061078280210495,0.0009031521040014923,0.0034274966455996037,-0.025739213451743126,-0.0034957160241901875,-0.02640336938202381,-0.019503125920891762,0.032625310122966766,0.008006369695067406,0.010506460443139076,0.010643737390637398,-0.002503338037058711,0.01156450156122446,-0.04965271055698395,0.0679670125246048,-0.005748685449361801,-0.00778236472979188,0.009481523185968399,0.00871544610708952,-0.02106267213821411,-0.022487947717308998,-0.03128858283162117,-0.016993727535009384,0.013434244319796562,0.0017884609987959266,-0.0024710462894290686,-0.017959944903850555,-0.014335518702864647,0.02691134810447693,0.04465331509709358,0.029495909810066223,-0.02635963261127472,0.035436902195215225,0.10094207525253296,0.004390018992125988,0.0009340281249023974,-0.04524293169379234,0.021418044343590736,-0.05956793203949928,0.0017597863916307688,-0.05903895944356918,0.023769211024045944,0.014180279336869717,-0.008166740648448467,0.02303720824420452,0.010815550573170185,-0.03036920353770256,-0.023754950612783432,0.03811511769890785,0.03625554218888283,-0.020034316927194595,0.032796017825603485,-0.004072101321071386,0.03822813928127289,-0.0031090762931853533,-0.0025291922502219677,0.005204276647418737,-0.0156723503023386,-0.027836056426167488,-0.044359587132930756,0.034850820899009705,-0.008934170007705688,-0.004775969311594963,0.004285341128706932,-0.014048836193978786,-0.0067567178048193455,0.03459908068180084,0.01820729300379753,-0.025760382413864136,0.038231633603572845,0.03333388641476631,-0.05142434313893318,-0.024797087535262108,0.04476439952850342,0.04250452667474747,-0.03723198175430298,-0.028837649151682854,-0.020540906116366386,0.01641450822353363,-0.026654930785298347,-0.008292258717119694,0.044563937932252884,-0.02520473673939705,-0.039976540952920914,0.027995405718684196,0.01803576946258545,0.0010205954313278198,0.020021207630634308,-0.012649457901716232,-0.02098412998020649,0.05638851597905159,0.011408013291656971,-0.027536258101463318,-0.033197518438100815,0.029403110966086388,-0.04456411302089691,-0.014448381029069424,-0.024413950741291046,0.06824693083763123,0.007285042200237513,-0.033849384635686874,0.009168616496026516,-0.012990021146833897,-0.13251660764217377,-0.03280903398990631,-0.014275914989411831,0.020374970510601997,0.00817705038934946,-0.009782730601727962,-0.07158806920051575,-0.011243708431720734,0.002516342792659998,0.06266816705465317,-0.02026326395571232,-0.059042684733867645,0.012037320993840694,0.0031802484299987555,-0.006634697318077087,-0.01198265329003334,-0.02755388244986534,-0.019416136667132378,0.01612813025712967,-0.05008013918995857,-0.03285703435540199,-0.023529058322310448,0.035121552646160126,0.005613523069769144,-0.03597012534737587,0.004668953362852335,0.021609775722026825,-0.012366993352770805,-0.040257230401039124,-0.022291501984000206,-0.06050226464867592,0.049908507615327835,-0.008719722740352154,0.048623498529195786,0.0010433349525555968,0.05249406397342682,0.014562529511749744,-0.01845763809978962,0.02634814940392971,0.017018437385559082,0.022231822833418846,0.0005858801887370646,-0.037503570318222046,0.019017668440937996,0.004650314804166555,-0.002004263922572136,-0.034743182361125946,0.04317222908139229,-0.02504369243979454,-0.01363216433674097,0.0278327614068985,-0.018447358161211014,0.045319415628910065,-0.01395604107528925,-0.009115422144532204,0.011384333483874798,-0.024450641125440598,-0.010400857776403427,-0.020801059901714325,0.0532284714281559,-0.03091302327811718,0.012498337775468826,0.014546402730047703,0.060453787446022034,-0.011982751078903675,0.028568144887685776,-0.04307336360216141,-0.03894389048218727,0.043597202748060226,0.005097685847431421,0.014795859344303608,-0.0128038814291358,0.01343140471726656,-0.021620359271764755,-0.03791474178433418,-0.024414362385869026,-0.010476171039044857,-0.0389404371380806,0.009181478060781956,-0.08720149099826813,-0.06557508558034897,-0.01216561533510685,-0.02261705882847309,0.027464957907795906,0.009873147122561932,-0.03790777176618576,0.03245813772082329,0.006283318158239126,0.04392092302441597,0.18762412667274475,0.0015569078968837857,0.008472210727632046,-0.003119369503110647,0.05156579241156578,0.011710809543728828,-0.018842794001102448,0.02917603589594364,-0.05088569223880768,-0.0287027508020401,-0.003951418213546276,-0.007733418606221676,-0.019249293953180313,-0.023889081552624702,-0.011261733248829842,0.012606333009898663,0.015149480663239956,-0.029680438339710236,0.09333977848291397,-0.00013500450586434454,0.03528391197323799,-0.02519160881638527,-0.014547883532941341,0.014552644453942776,0.02114703506231308,-0.05189337581396103,0.004334751982241869,0.019517457112669945,-0.036815088242292404,0.00011842197272926569,-0.027657296508550644,-0.020344922319054604,0.03771381080150604,-0.0027515485417097807,-0.003933642525225878,-0.03455400466918945,-0.020026030018925667,-0.018802380189299583,-0.02347439154982567,0.02910885214805603,-0.005764256697148085,-0.03580589219927788,-0.019720718264579773,0.03072458691895008,-0.026009108871221542,0.050795771181583405,-0.016409602016210556,-0.047235891222953796,-0.012889576144516468,0.013285423628985882,0.029989730566740036,-0.00787315797060728,0.005495417397469282,0.022965462878346443,0.039564698934555054,-0.0409771129488945,-0.008550125174224377,0.020423047244548798,-0.011985637247562408,0.02098277397453785,0.027929922565817833,0.0025344821624457836,-0.08767720311880112,0.028005370870232582,0.0009481562883593142,0.011713268235325813,0.039828021079301834,-0.019305771216750145,0.04894671216607094,0.040866706520318985,0.022028228268027306,0.016010712832212448,0.023800572380423546,0.003740418003872037,0.00014643646136391908,-0.02804023213684559,-0.011580223217606544,0.021959789097309113,0.010988298803567886,-0.02873842604458332,-0.0015563899651169777,-0.038517072796821594,-0.004493627697229385,0.03620840236544609,-0.006006571464240551,0.016570894047617912,-0.00337125058285892,0.020966172218322754,0.042241454124450684,-0.031139861792325974,-0.05274248123168945,-0.0034346955362707376,-0.028965774923563004,-0.05007054656744003,-0.035811107605695724,0.013463050127029419,-0.010950863361358643,0.03897807002067566,-0.055708568543195724,-0.014721239916980267,0.029290711507201195,-0.021006805822253227,0.0025831153616309166,-0.042123906314373016,-0.00037095314473845065,-0.020786777138710022,0.012342908419668674,-0.009422508999705315,0.009251424111425877,0.003476251382380724,-0.005067756399512291,0.04398060590028763,0.008799305185675621,-0.007124000694602728,0.035534221678972244,0.006025924347341061,-0.00026875341427512467,0.011491668410599232,0.005126778036355972,0.0033774138428270817,-0.04069878160953522,-0.03145385906100273,-0.006302133202552795,-0.02811228670179844,-0.016871342435479164,-0.05399102717638016,-0.027439488098025322,0.04627895727753639,-0.031295616179704666,0.057926613837480545,0.005837196949869394,-0.022443650290369987,-0.03381342068314552,0.027001941576600075,0.05063868314027786,-0.020800843834877014,0.07718729227781296,0.021754147484898567,0.042538195848464966,0.027882715687155724,0.007830724120140076,-0.020669208839535713,0.0020759471226483583,0.025989646092057228,-0.028320474550127983,-0.014761989004909992,0.02385944314301014,-0.056272707879543304,0.030338367447257042,0.03631681576371193,0.03115236945450306,0.001322458265349269,-0.001602170872502029,-0.06074734777212143,0.002262378577142954,-0.002561628818511963,-0.005282154772430658,0.016638249158859253,-0.03494030237197876,-0.030911481007933617,-0.0039108265191316605,0.04560539126396179,-0.007855018600821495,0.037990499287843704,-0.03230845928192139,0.022280914708971977,0.049428973346948624,0.02195615880191326,-0.004151022527366877,-0.05515941604971886,-0.01571415737271309,-0.048389457166194916,-0.04875185340642929,-0.012032483704388142,0.029595505446195602,0.03575676679611206,-0.016226746141910553,0.01148922462016344,-4.673020157497376e-05,0.002419161843135953,0.01062636636197567,-0.004526807926595211,-0.01869310438632965,0.03169547766447067,-0.0039108493365347385,0.027311624959111214,0.013312522321939468,-0.02384008653461933,0.021067989990115166,0.008289112709462643,0.01721593365073204,0.13498540222644806,-0.025301247835159302,-0.016628099605441093,0.002610675757750869,-0.0014455715427175164,-0.0012895830441266298,-0.004241904243826866,-0.021494857966899872,-0.007915129885077477,-0.023129431530833244,-0.06289039552211761,0.0067895399406552315,-0.019609197974205017,0.008477495983242989,-0.02340853586792946,-0.013962173834443092,0.043029122054576874,0.011256991885602474,0.006615206599235535,0.00842709094285965,0.011110953986644745,-0.03900165483355522,-0.02272004447877407,-0.019889919087290764,-0.020560285076498985,0.06560773402452469,0.04035598039627075,-0.014076421968638897,-0.02827203832566738,-0.020347245037555695,0.001084661460481584,0.046784866601228714,-0.03711411729454994,-0.01874317228794098,-0.026953237131237984,0.057653650641441345,-0.05347362905740738,0.00406127842143178,-0.004725798033177853,0.0038419198244810104,0.011449555866420269,-0.04481260105967522,0.026740707457065582,0.005487699527293444,0.015189622528851032,-0.01655558869242668,0.01839543506503105,0.03188752010464668,-0.07560966163873672,0.01762406900525093,0.018275057896971703,-0.0018259439384564757,0.06723477691411972,-0.009778632782399654,0.048699621111154556,0.011191237717866898,-0.023585855960845947,0.06043824926018715,0.033316511660814285,-0.03646458685398102,0.03171839937567711,0.039061401039361954,-0.03299668803811073,0.011758765205740929,0.010716218501329422,0.009823662228882313,0.0055337040685117245,-0.02027781680226326,0.044434238225221634,-0.023417990654706955,0.025252310559153557,-0.01637844741344452,0.026325467973947525,0.012743460945785046,-0.03733571246266365,0.003902609460055828,-0.08160773664712906,-0.0019635192584246397,-0.026534466072916985,-0.02705235593020916,-0.011190318502485752,-0.054863397032022476,-0.022469429299235344,0.011640398763120174,0.03063529171049595,-0.008080911822617054,-0.0083406250923872,0.006630913354456425,0.0009113330743275583,-0.02985531836748123,0.00409055408090353,-0.04290902987122536,-0.0031625544652342796,0.011664650402963161,-0.016200240701436996,0.011208810843527317,0.02941548451781273,0.00859347265213728,-0.04806976392865181,-0.04140814393758774,-0.03160985931754112,-0.06015832722187042,0.0036413148045539856,-0.008150891400873661,-0.01953221671283245,-0.03326787054538727,0.03622032701969147,0.00447751535102725,-0.014975418336689472,-0.020837996155023575,0.00940431747585535,-0.034587785601615906,-0.0346517339348793,-0.031099582090973854,0.028304044157266617,0.031032660976052284,-0.054100193083286285,0.011798872612416744,0.03959617763757706,0.007479812949895859,0.019984576851129532,0.0023249092046171427,0.0017746787052601576,0.06018313020467758,0.0046693491749465466,0.020751764997839928,0.024023782461881638,-0.010837688110768795,-0.025447187945246696,0.04806412383913994,-0.005525335669517517,-0.010020580142736435,0.03294605389237404,0.027606314048171043,-0.03561466559767723,0.01953313499689102,-0.02203267440199852,-0.008873567916452885,-0.03560421243309975,0.0016935168532654643,-0.013018500059843063,0.008578465320169926,-0.03372406214475632,-0.02363605424761772,0.024753427132964134,0.03885240480303764,0.01567702740430832,-0.017730925232172012,0.023637020960450172,0.006857735104858875,0.03580120950937271,0.07028796523809433,-0.04534495621919632,0.0465860590338707,0.0822998434305191,0.014615395106375217,-0.014257163740694523,0.01820719987154007,-0.03359945863485336,-0.0037654018960893154,0.027387084439396858,-0.012686132453382015,-0.03165066987276077,0.025856807827949524,0.013975927606225014,-0.047755271196365356,0.009596090763807297,0.035378195345401764,-0.023031650111079216,-0.052946560084819794,0.03902287408709526,-0.08697628974914551,0.0007650483748875558,-0.02747396193444729,0.039477840065956116,-0.029907599091529846,-0.03874655067920685,0.040488775819540024,-0.002082259627059102,-0.0248007420450449,0.017285620793700218,-0.01977693662047386,-0.033778440207242966,-0.013919990509748459,0.042479753494262695,-0.0031244901474565268,-0.020827699452638626,0.04649842530488968,0.011807293631136417,-0.007776105310767889,0.004212469793856144,0.006400883663445711,-0.021155664697289467,0.013709750957787037,-0.033320777118206024,-0.06184367835521698,0.00829515140503645,0.033842090517282486,0.031176408752799034,-0.03214312344789505,-0.003411807119846344,0.005028052721172571,0.01470850221812725,-0.12694455683231354,0.0018897703848779202,0.01791737787425518,-0.03597062826156616,-0.04750250279903412,0.03563278540968895,-0.056755904108285904,-0.0744595155119896,0.0177844800055027,0.027669426053762436,-0.05378463864326477,-0.01707536168396473,0.0344446562230587,-0.05133352801203728,0.024937760084867477,0.02161405235528946,0.029253298416733742,-0.04146696254611015,-0.022549767047166824,0.03452726826071739,0.029425887390971184,-0.023544203490018845,0.052563101053237915,0.02415809966623783,-0.006997709162533283,-0.036546677350997925,0.0003408585616853088,-0.015558761544525623,-0.04703343287110329,-0.027171388268470764,0.048803865909576416,-0.0120015237480402,0.019953399896621704,0.056174542754888535,0.08862745761871338,0.024920575320720673,0.013407970778644085,-0.042790595442056656,-0.005297323223203421,0.026501381769776344,0.060773059725761414,0.01442534476518631,0.010794523172080517,-0.012532815337181091,0.013845203444361687,-0.013856259174644947,0.03645479679107666,0.000491056649480015,-0.017692672088742256,-0.004449401516467333,0.005704398732632399,0.055144648998975754,0.024484168738126755,0.0009120836621150374,0.02769780158996582,-0.04721996560692787,-0.0437353141605854,-0.03426419943571091,-0.0030353472102433443,0.06532897800207138,0.005175999831408262,0.004642026498913765,-0.010198553092777729,-0.11164741963148117,0.0032722693867981434,-0.0152249401435256,-0.061387427151203156,-0.008149731904268265,0.015415345318615437,0.028577173128724098,0.004164310172200203,-0.03527858853340149,0.004114644601941109,-0.024334382265806198,0.009768039919435978,0.036615774035453796,0.044409748166799545,-0.02218494936823845,-0.013834587298333645,-0.033721648156642914,0.012608193792402744,0.02544715628027916,-0.011161528527736664,0.024172907695174217,0.01728871837258339,-0.034891944378614426,-0.045166727155447006,0.03149036690592766,-0.028676412999629974,-0.025630123913288116,-0.03450291231274605,-0.042594075202941895,-0.004277938045561314,0.004977126140147448,-0.026740560308098793,0.010828261263668537,-0.008786126039922237,0.025455767288804054,0.010332930833101273,-0.029624290764331818,0.025222910568118095,-0.05332495644688606,0.020215490832924843,-0.00725834583863616,-0.014051979407668114,0.025231482461094856,0.02870739810168743,-0.025153715163469315,0.0017486201832070947,0.026120835915207863,-0.01094944030046463,-0.0016203569248318672,-0.004288187250494957,-0.0003944599302485585,-0.04951595887541771,-0.027722930535674095,0.021247882395982742,-0.025441348552703857,-0.029132012277841568,0.02611704356968403,0.03426678851246834,-0.03205306455492973,0.043122775852680206,-0.037530578672885895,0.010123169049620628,0.006026758812367916,0.06166285276412964,0.041947267949581146,-0.028590155765414238,0.005821961909532547,0.03878951445221901,-0.043678734451532364,0.021891968324780464,0.019588861614465714,0.02722681127488613,-0.0072005135007202625,-0.014661637134850025,0.03859248012304306,-0.03036857396364212,-0.025163188576698303,-0.029624272137880325,-0.004484932404011488,-0.02115587703883648,-0.034703899174928665,-0.020665785297751427,0.03465457260608673,-0.032381970435380936,-0.02448100969195366,-0.03633696585893631,-0.0436834841966629,0.023309791460633278,-0.026956286281347275,-0.010952495969831944,0.017641672864556313,-0.0102300513535738,0.003557136282324791,-0.06104337051510811,-0.034807249903678894,-0.005303672980517149,-0.004773163702338934,-0.014427333138883114,-0.0012221967335790396,-0.013541251420974731,0.031239276751875877,0.0007876901072449982,-0.01612892746925354,-0.020762234926223755,-0.012705235742032528,-0.04261665791273117,0.006554049905389547,-0.05181668698787689,-0.0010232614586129785,-0.02920578606426716,0.04016171023249626,0.05727822706103325,-0.0637064278125763,0.042474739253520966,-0.02202245034277439,0.053862642496824265,-0.04091379791498184,-0.00358423194848001,-0.0294108297675848,-0.019521895796060562,0.0008547710021957755,0.05577182397246361,-0.0064692022278904915,-0.039945632219314575,0.03217395022511482,0.008500233292579651,0.0010580146918073297,0.0230677742511034,0.015775218605995178,0.04561731964349747,-0.01410161703824997,0.01426507718861103,0.051053181290626526,-0.015263228677213192,0.06109631061553955,-0.020236019045114517,0.03534768521785736,-0.011433257721364498,0.024448689073324203,-0.002005173359066248,-0.013818801380693913,-0.005125164985656738,-0.011358902789652348,-0.014218742959201336,-0.01632663980126381,-0.0168970488011837,-0.007923102006316185,0.0009882465237751603,0.004870997276157141,-0.0316762775182724,-0.009269092231988907,-0.024636149406433105,-0.03711302578449249,-0.017021233215928078,0.05177905783057213,0.010371671989560127,0.04589727520942688,-0.002231868449598551,0.043219443410634995,-0.06742873787879944,0.012290364131331444,-0.03116980940103531,0.029974913224577904,-0.03351745754480362,0.020384468138217926,0.009360012598335743,-0.026679668575525284,0.03614602982997894,-0.03352091833949089,0.0024363042321056128,0.026183461770415306,-0.00671287951990962,-0.02230038307607174,0.04167525842785835,-0.014078160747885704,-0.01655763015151024,-0.037968363612890244,0.032015733420848846,0.0222366563975811,0.04600703343749046,0.02889135293662548],"k":600,"num_candidates":800,"_name":"knn_query"}}],"minimum_should_match":1}}],"filter":[{"term":{"platform_sku_essaone":true}},{"term":{"platform_rule_essaone":true}},{"terms":{"status":[2,4,5]}}]}},"functions":[{"filter":{"term":{"label_id_list":156}},"weight":1.14},{"filter":{"term":{"label_id_list":157}},"weight":1.13},{"filter":{"term":{"label_id_list":158}},"weight":1.1},{"filter":{"term":{"label_id_list":159}},"weight":1.1},{"filter":{"term":{"label_id_list":162}},"weight":1.05},{"filter":{"term":{"label_id_list":163}},"weight":1.1},{"filter":{"term":{"label_id_list":164}},"weight":1.13},{"filter":{"term":{"label_id_list":165}},"weight":1.15},{"field_value_factor":{"field":"on_sell_days_boost","missing":1.0}},{"filter":{"term":{"is_video":true}},"weight":1.2}],"score_mode":"max","boost_mode":"multiply"}},"track_scores":true,"collapse":{"field":"goods_id"},"aggs":{"unique_count":{"cardinality":{"field":"goods_id"}}}} - - - -2025-06-28 12:00:09,683 - INFO - [REQ: 175108319225300 UID: -1] TIMING: QA=0ms, queryEncoding=0ms, userProfile=0ms, ES=13905ms, BgeReranking=0ms, BizReranking=5ms, Reranking=6ms, total=14649ms, sku_id_list_filling=732ms - -2025-06-28 12:00:34,322 - INFO - [REQ: 175108315581700 UID: -1] TIMING: QA=47ms, queryEncoding=0ms, userProfile=0ms, ES=14587ms, BgeReranking=787ms, BizReranking=1ms, Reranking=789ms, total=16736ms, sku_id_list_filling=1309ms - -2025-06-28 12:23:45,140 - INFO - [REQ: 175108461841000 UID: -1] TIMING: QA=0ms, queryEncoding=0ms, userProfile=0ms, ES=5829ms, BgeReranking=0ms, BizReranking=0ms, Reranking=0ms, total=5832ms - -2025-06-28 15:07:36,848 - INFO - [REQ: 0 UID: -1] TIMING: QA=139ms, queryEncoding=82ms, userProfile=0ms, ES=13312ms, BgeReranking=2098ms, BizReranking=10ms, Reranking=2111ms, total=15793ms, sku_id_list_filling=199ms - -2025-06-28 15:42:52,404 - INFO - [REQ: 17510963864686712 UID: 6712] TIMING: QA=0ms, queryEncoding=0ms, userProfile=1ms, ES=1990ms, BgeReranking=0ms, BizReranking=5ms, Reranking=6ms, total=2090ms, sku_id_list_filling=86ms - - - ------------------------------------------ - -## 参考资料 - -### 1. 商品搜索、工厂搜索的聚合 - -#### 1.1 聚合字段优化 -- 商品搜索的 goodsId聚合、和工厂搜索的 brandId聚合,现在的 collapse 是否是最优方案,是否还能同时得到 inner_hits - -### 2. aggs 方面 - -现在的方案是: - -```json -"aggs": { - "category_stats": { - "terms": { - "field": "sale_category_all", - "size": 100 - } - } -} -``` - -#### 2.1 top_hits聚合 -预期是通过减少聚合的候选数量(只对topN进行聚合)来提升性能,但是测试好像更差。测试样本量也不够,写法也有好多种,因此看有没有专业建议。 - -这种方式试了几个好像差不多: - -```json -"aggs": { - "top_hits_agg": { - "sampler": { - "shard_size": 5000 // 关键优化1:仅对前5000文档聚合 - }, - "aggs": { - // 所有的聚合字段 - } - } -} -``` - -或者对每个聚合字段加 top_hits 配置,不知道为什么很慢: - -```json -"aggs": { - "category_stats": { - "top_hits": { - "size": 2 - } - } -} -``` - -#### 2.2 execution_hint优化 -加 "execution_hint": "map" 属性(全内存操作,适用聚合结果数量很小、内存够用的情况) - -```json -"aggs": { - "tags": { - "terms": { - "field": "status", - "execution_hint": "map" - } - } -} -``` - -### 3. 检索表达式 - -通过function_score设定提权。 - -```json -GET /spu/_search -{ - "aggs": { - "top_hits_agg": { - "sampler": { - "shard_size": 5000 // 关键优化1:仅对前5000文档聚合 - } - } - }, - "collapse": { - "field": "goods_id" - }, - "from": 0, - "size": 1000, - "track_scores": true, - "query": { - "function_score": { - "query": { - "bool": { - "filter": [ - { - "terms": { - "status": ["2", "4", "5"] - } - } - ], - "must": [ - { - "bool": { - "minimum_should_match": 1, - "should": [ - { - "multi_match": { - "fields": ["name_zh^2.0", "goods_keyword_zh", "category_name_zh", "sale_category_keyword_zh", "sub_name_zh"], - "query": "合金滑行 喷漆", - "minimum_should_match": 2, - "tie_breaker": 0.301 - } - }, - { - "knn": { - "field": "embedding_name_zh", - "k": 1000, - "num_candidates": 1000, - "query_vector": [0.1,1.1,0.6] - } - } - ] - } - } - ] - } - }, - "functions": [ - { - "filter": { "term": { "label_id_list": 156 } }, - "weight": 1.1 - }, - { - "field_value_factor": { - "field": "on_sell_days_boost", - "missing": 1 - } - } - ], - "score_mode": "max", - "boost_mode": "multiply" - } - }, - "rescore": { // 关键优化2:仅对前N结果应用函数评分 - "window_size": 2000, - "query": { - "rescore_query": { - "function_score": { - "query": {"match_all": {}}, - "functions": [ - { - "filter": {"term": {"label_id_list": 156}}, - "weight": 1.1 - }, - { - "field_value_factor": { - "field": "on_sell_days_boost", - "missing": 1 - } - } - ], - "score_mode": "max", - "boost_mode": "multiply" - } - } - } - } -} -``` - -#### 可以考虑的优化: -1. 提权只对主检索表达式topN window_size - -### 4. ES索引优化 - -所有的term字段,如果是int类型,改为int,现在是字符串。 - -不过好像请求用int也能匹配到,所以ES本身检测如果是数值,那么也会为int类型建立一个倒排?这样的话,如果指定为int,只是节省了一些内存(不再需要为字符串类型建立倒排) - -### 5. ES配置优化建议 - -针对单机、低QPS、5百万级别doc,性能优化建议。ES配置方面。 - diff --git a/docs/ES/install.sh b/docs/ES/install.sh deleted file mode 100644 index 2fa7750..0000000 --- a/docs/ES/install.sh +++ /dev/null @@ -1,47 +0,0 @@ - -wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.18.0-x86_64.rpm -# wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-9.0.0-x86_64.rpm - -sudo rpm -ivh elasticsearch-8.18.0-x86_64.rpm - -sudo systemctl daemon-reload -sudo systemctl enable elasticsearch.service -sudo systemctl start elasticsearch.service - - - -好的,下面是你安装 Elasticsearch 8.18.0 时的详细信息和解释: -警告:NOKEY - -这个警告表示你安装的 RPM 包是用一个密钥(d88e42b4)签名的,但是你的系统没有这个密钥。这通常是无害的,前提是你信任这个包的来源。如果想避免这个警告,你可以导入 Elasticsearch 的 GPG 密钥: -bash -sudo rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch -安全自动配置 - -Elasticsearch 已经自动启用了传输层和 HTTP 层的 TLS 加密,并且为内置的超级用户 elastic 生成了一个密码(6T_Oq+1Gd=E_MZt=zn6X)。你需要保管好这个密码,初次登录时会用到。 -节点配置 - -如果这个节点需要加入现有的 Elasticsearch 集群,你可以使用集群中生成的 enrollment token 来配置。运行提供的命令来加入集群: -bash -/usr/share/elasticsearch/bin/elasticsearch-reconfigure-node --enrollment-token -服务配置 - -Elasticsearch 没有在安装后自动启动,你需要运行以下命令来使服务自启动并启动它: -bash -sudo systemctl daemon-reload -sudo systemctl enable elasticsearch.service -sudo systemctl start elasticsearch.service -tmpfiles.d 的警告 - -这个警告是由于某个配置文件中引用了 /var/run/elasticsearch,但是这个目录已经不再推荐使用,应该更新为 /run/elasticsearch。这只是一个配置上的小问题,不会影响 Elasticsearch 的正常工作。 - -下一步: - -如果你希望消除 NOKEY 警告,可以导入 GPG 密钥(可选)。 -使用以下命令启动 Elasticsearch 服务: -bash -sudo systemctl daemon-reload -sudo systemctl enable elasticsearch.service -sudo systemctl start elasticsearch.service -使用生成的 elastic 用户密码进行初次登录。 -如果你有特殊需求,可以根据提示更新 tmpfiles 配置。 diff --git a/mappings/search_products.json b/mappings/search_products.json index 9b1706e..10f1323 100644 --- a/mappings/search_products.json +++ b/mappings/search_products.json @@ -994,7 +994,8 @@ "type": "dense_vector", "dims": 1024, "index": true, - "similarity": "dot_product" + "similarity": "dot_product", + "element_type": "bfloat16" }, "image_embedding": { "type": "nested", @@ -1003,7 +1004,8 @@ "type": "dense_vector", "dims": 1024, "index": true, - "similarity": "dot_product" + "similarity": "dot_product", + "element_type": "bfloat16" }, "url": { "type": "text" @@ -1017,7 +1019,8 @@ "type": "dense_vector", "dims": 512, "index": true, - "similarity": "dot_product" + "similarity": "dot_product", + "element_type": "bfloat16" }, "url": { "type": "text" -- libgit2 0.21.2