Commit 654f20d1371c4e5eeb7622ff0ba2d7df522a3279

Authored by tangwang
1 parent bcada818

分词改为ik

CLAUDE.md
... ... @@ -342,9 +342,6 @@ query_config:
342 342 enable_translation: true # DeepL API integration
343 343 enable_text_embedding: true # BGE-M3 vector search
344 344 enable_query_rewrite: true # Dictionary-based expansion
345   - embedding_disable_thresholds:
346   - chinese_char_limit: 4 # Short query optimization
347   - english_word_limit: 3
348 345 ```
349 346  
350 347 **Ranking Formula**:
... ...
config/config.yaml
... ... @@ -77,11 +77,6 @@ query_config:
77 77 text_embedding_field: "title_embedding"
78 78 image_embedding_field: null
79 79  
80   - # Embedding禁用阈值(短查询不使用向量搜索)
81   - embedding_disable_thresholds:
82   - chinese_char_limit: 4
83   - english_word_limit: 3
84   -
85 80 # 翻译API配置(provider/URL 在 services.translation)
86 81 translation_service: "deepl"
87 82 translation_api_key: null # 通过环境变量设置
... ...
mappings/search_products.json
... ... @@ -5,17 +5,17 @@
5 5 "refresh_interval": "30s",
6 6 "analysis": {
7 7 "analyzer": {
8   - "index_ansj": {
  8 + "index_ik": {
9 9 "type": "custom",
10   - "tokenizer": "standard",
  10 + "tokenizer": "ik_max_word",
11 11 "filter": [
12 12 "lowercase",
13 13 "asciifolding"
14 14 ]
15 15 },
16   - "query_ansj": {
  16 + "query_ik": {
17 17 "type": "custom",
18   - "tokenizer": "standard",
  18 + "tokenizer": "ik_smart",
19 19 "filter": [
20 20 "lowercase",
21 21 "asciifolding"
... ... @@ -58,8 +58,8 @@
58 58 "properties": {
59 59 "zh": {
60 60 "type": "text",
61   - "analyzer": "index_ansj",
62   - "search_analyzer": "query_ansj"
  61 + "analyzer": "index_ik",
  62 + "search_analyzer": "query_ik"
63 63 },
64 64 "en": {
65 65 "type": "text",
... ... @@ -184,8 +184,8 @@
184 184 "properties": {
185 185 "zh": {
186 186 "type": "text",
187   - "analyzer": "index_ansj",
188   - "search_analyzer": "query_ansj"
  187 + "analyzer": "index_ik",
  188 + "search_analyzer": "query_ik"
189 189 },
190 190 "en": {
191 191 "type": "text",
... ... @@ -310,8 +310,8 @@
310 310 "properties": {
311 311 "zh": {
312 312 "type": "text",
313   - "analyzer": "index_ansj",
314   - "search_analyzer": "query_ansj"
  313 + "analyzer": "index_ik",
  314 + "search_analyzer": "query_ik"
315 315 },
316 316 "en": {
317 317 "type": "text",
... ... @@ -436,8 +436,8 @@
436 436 "properties": {
437 437 "zh": {
438 438 "type": "text",
439   - "analyzer": "index_ansj",
440   - "search_analyzer": "query_ansj"
  439 + "analyzer": "index_ik",
  440 + "search_analyzer": "query_ik"
441 441 },
442 442 "en": {
443 443 "type": "text",
... ... @@ -562,8 +562,8 @@
562 562 "properties": {
563 563 "zh": {
564 564 "type": "text",
565   - "analyzer": "index_ansj",
566   - "search_analyzer": "query_ansj"
  565 + "analyzer": "index_ik",
  566 + "search_analyzer": "query_ik"
567 567 },
568 568 "en": {
569 569 "type": "text",
... ... @@ -688,8 +688,8 @@
688 688 "properties": {
689 689 "zh": {
690 690 "type": "text",
691   - "analyzer": "index_ansj",
692   - "search_analyzer": "query_ansj"
  691 + "analyzer": "index_ik",
  692 + "search_analyzer": "query_ik"
693 693 },
694 694 "en": {
695 695 "type": "text",
... ... @@ -1032,8 +1032,8 @@
1032 1032 "properties": {
1033 1033 "zh": {
1034 1034 "type": "text",
1035   - "analyzer": "index_ansj",
1036   - "search_analyzer": "query_ansj"
  1035 + "analyzer": "index_ik",
  1036 + "search_analyzer": "query_ik"
1037 1037 },
1038 1038 "en": {
1039 1039 "type": "text",
... ... @@ -1158,8 +1158,8 @@
1158 1158 "properties": {
1159 1159 "zh": {
1160 1160 "type": "text",
1161   - "analyzer": "index_ansj",
1162   - "search_analyzer": "query_ansj"
  1161 + "analyzer": "index_ik",
  1162 + "search_analyzer": "query_ik"
1163 1163 },
1164 1164 "en": {
1165 1165 "type": "text",
... ...