当前位置: 首页 > news >正文

ElasticSearch 同义词匹配

 synonym.txt

电脑, 计算机, 主机
复印纸, 打印纸, A4纸, 纸, A3
平板电脑, Pad
DELETE /es_sku_index_20_20250109
PUT /es_sku_index_20_20250109
{"settings": {"index": {"number_of_shards": "5","number_of_replicas": "1","analysis": {"filter": {"light_english_stemmer": {"type": "stemmer","language": "light_english"},"sku_synonym": {"type": "synonym","synonyms_path": "synonym/synonym.txt"}},"analyzer": {"optik_smart_with_synonym": {"type": "custom","tokenizer": "ik_smart","filter": ["lowercase","light_english_stemmer","sku_synonym"]},"optik_with_synonym": {"type": "custom","tokenizer": "ik_max_word","filter": ["lowercase","light_english_stemmer","sku_synonym"]},"optik_smart": {"type": "custom","tokenizer": "ik_smart","filter": ["lowercase", "light_english_stemmer"]},"optik": {"type": "custom","tokenizer": "ik_max_word","filter": ["lowercase", "light_english_stemmer"]},"sku_synonym_analyzer": {"type": "custom","tokenizer": "standard","filter": ["lowercase", "sku_synonym"]}}}}},"mappings": {"sku": {"properties": {"chiefQualifications": {"type": "text"},"agreementStatus": {"type": "long"},"sellPrice": {"type": "double"},"saleAttributes": {"type": "nested","properties": {"attrNames": {"search_analyzer": "optik_smart","analyzer": "optik","type": "text"},"value": {"type": "long"},"key": {"type": "long"}}},"contactTel": {"type": "text"},"categoryKeyWord": {"search_analyzer": "optik_smart","analyzer": "optik","type": "text"},"isAgent": {"type": "integer"},"skuNameSearch": {"type": "keyword"},"cName": {"type": "text","fields": {"cName_search": {"type": "text","analyzer": "optik_smart_with_synonym","search_analyzer": "optik_smart_with_synonym"},"cName_view": {"type": "keyword"}}},"modelCode": {"search_analyzer": "optik_smart","analyzer": "optik","type": "text"},"modified": {"format": "yyyy-MM-dd HH:mm:ss","type": "date"},"shelfSkuTime": {"type": "text","fields": {"keyword": {"ignore_above": 256,"type": "keyword"}}},"shopId": {"type": "long"},"skuId": {"type": "long"},"policyAttributes": {"type": "nested","properties": {"valueName": {"type": "keyword"},"value": {"type": "integer"},"key": {"type": "keyword"}}},"created": {"format": "yyyy-MM-dd HH:mm:ss","type": "date"},"listingTime": {"format": "yyyy-MM-dd","type": "date"},"pictureUrl": {"type": "keyword"},"brandKeyWord": {"type": "text","analyzer": "sku_synonym_analyzer","search_analyzer": "optik_smart"},"itemId": {"type": "long"},"praiseRate": {"type": "float"},"brandNameCh": {"type": "keyword"},"publishType": {"type": "integer"},"brandId": {"type": "long"},"minPrice": {"type": "double"},"keyAttributesNum": {"type": "integer"},"maxPrice": {"type": "double"},"cid": {"type": "long"},"secondTel": {"type": "text"},"supplierId": {"type": "long"},"categoryAttributes": {"type": "nested","properties": {"value": {"type": "long"},"key": {"type": "long"}}},"shopName": {"type": "text","fields": {"shopName_view": {"type": "keyword"},"shopName_search": {"type": "text","analyzer": "optik_smart_with_synonym","search_analyzer": "optik_smart_with_synonym"}}},"enterpriseScale": {"type": "integer"},"agentNum": {"type": "integer"},"skuName": {"type": "text","analyzer": "optik_smart_with_synonym","search_analyzer": "optik_smart_with_synonym"},"saleAttributesNum": {"type": "integer"},"supplierName": {"type": "keyword"},"saleCount": {"type": "long"},"secondContacts": {"type": "text"},"keyAttributes": {"type": "nested","properties": {"attrNames": {"search_analyzer": "optik_smart","analyzer": "optik","type": "text"},"value": {"type": "long"},"key": {"type": "long"}}},"platformId": {"type": "long"},"saleStatus": {"type": "integer"},"otherQualifications": {"type": "text"},"agreementNo": {"type": "keyword"},"brandNameEn": {"type": "keyword"},"sourceSkuId": {"search_analyzer": "optik_smart","analyzer": "optik","type": "text"},"categoryAttributesNum": {"type": "integer"},"brandNameChEn": {"type": "text","fields": {"brandNameChEn_agg": {"type": "keyword"},"brandNameChEn_ik": {"type": "text","analyzer": "optik_smart_with_synonym","search_analyzer": "optik_smart_with_synonym"}}},"contacts": {"type": "text"}}}},"aliases": {"es_sku_index_alias_20": {}
}
}
POST _reindex
{"source": {"index": "es_sku_index_20_20221008"},"dest": {"index": "es_sku_index_20_20250109"}
}
POST /_aliases
{"actions": [{ "add":    { "index": "es_sku_index_20_20250109", "alias": "es_sku_index_alias_20" } },{ "remove": { "index": "es_sku_index_20_20221008", "alias": "es_sku_index_alias_20" } }]
}
GET /es_sku_index_20_20250109/_analyze
{"analyzer": "optik_smart_with_synonym","text": "复印纸"
}
GET /es_sku_index_20_20250109/_analyze
{"analyzer": "optik_smart_with_synonym","text": "打印纸"
}

http://www.lryc.cn/news/520635.html

相关文章:

  • linux RT-Preempt spin lock实现
  • PySpark广播表连接解决数据倾斜的完整案例
  • Chromium CDP 开发(十二):为自己的Domain建立custom_config.json
  • 【Vue】全局/局部组件使用流程(Vue2为例)
  • Vue.js组件开发详解
  • 解决:ubuntu22.04中IsaacGymEnv保存视频报错的问题
  • 深度学习camp-第J7周:对于ResNeXt-50算法的思考
  • java: 错误: 无效的源发行版:17解决办法
  • Docker 安装开源的IT资产管理系统Snipe-IT
  • Go语言封装加解密包(AES/DES/RSA)
  • sql server 对 nvarchar 类型的列进行 SUM() 运算
  • java中json字符串键值获取
  • MPLS原理及配置
  • 口碑很好的国产LDO芯片,有哪些?
  • 【流程设计】类似钉钉的流程设计功能样式demo
  • ChatGPT入门之文本情绪识别:先了解LSTM如何处理文字序列
  • 测试开发之面试宝典
  • 399. 除法求值【 力扣(LeetCode) 】
  • 算法日记1:洛谷p2678跳石头(二分答案)
  • Unity shader中真的可以动态关闭Stencil Test吗?
  • YOLOv9改进,YOLOv9自研检测头融合HyCTAS的Self_Attention自注意力机制,2024,适合目标检测、分割任务
  • 计算机网络 (36)TCP可靠传输的实现
  • Git版本控制 - 创建使用Repository
  • MySQL —— 在CentOS9下安装MySQL
  • LeetCode 热题 100_腐烂的橘子(52_994_中等_C++)(图;广度优先遍历(队列))
  • Nginx 可观测性最佳实践
  • LabVIEW光流跟踪算法
  • Jira用例自动去除summary重复用例
  • 基于openEuler22.03SP4部署Prometheus+Grafana
  • 泛目录和泛站有什么差别