Commit 654f20d1371c4e5eeb7622ff0ba2d7df522a3279
1 parent
bcada818
分词改为ik
Showing
3 changed files
with
20 additions
and
28 deletions
Show diff stats
CLAUDE.md
| @@ -342,9 +342,6 @@ query_config: | @@ -342,9 +342,6 @@ query_config: | ||
| 342 | enable_translation: true # DeepL API integration | 342 | enable_translation: true # DeepL API integration |
| 343 | enable_text_embedding: true # BGE-M3 vector search | 343 | enable_text_embedding: true # BGE-M3 vector search |
| 344 | enable_query_rewrite: true # Dictionary-based expansion | 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 | **Ranking Formula**: | 347 | **Ranking Formula**: |
config/config.yaml
| @@ -77,11 +77,6 @@ query_config: | @@ -77,11 +77,6 @@ query_config: | ||
| 77 | text_embedding_field: "title_embedding" | 77 | text_embedding_field: "title_embedding" |
| 78 | image_embedding_field: null | 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 | # 翻译API配置(provider/URL 在 services.translation) | 80 | # 翻译API配置(provider/URL 在 services.translation) |
| 86 | translation_service: "deepl" | 81 | translation_service: "deepl" |
| 87 | translation_api_key: null # 通过环境变量设置 | 82 | translation_api_key: null # 通过环境变量设置 |
mappings/search_products.json
| @@ -5,17 +5,17 @@ | @@ -5,17 +5,17 @@ | ||
| 5 | "refresh_interval": "30s", | 5 | "refresh_interval": "30s", |
| 6 | "analysis": { | 6 | "analysis": { |
| 7 | "analyzer": { | 7 | "analyzer": { |
| 8 | - "index_ansj": { | 8 | + "index_ik": { |
| 9 | "type": "custom", | 9 | "type": "custom", |
| 10 | - "tokenizer": "standard", | 10 | + "tokenizer": "ik_max_word", |
| 11 | "filter": [ | 11 | "filter": [ |
| 12 | "lowercase", | 12 | "lowercase", |
| 13 | "asciifolding" | 13 | "asciifolding" |
| 14 | ] | 14 | ] |
| 15 | }, | 15 | }, |
| 16 | - "query_ansj": { | 16 | + "query_ik": { |
| 17 | "type": "custom", | 17 | "type": "custom", |
| 18 | - "tokenizer": "standard", | 18 | + "tokenizer": "ik_smart", |
| 19 | "filter": [ | 19 | "filter": [ |
| 20 | "lowercase", | 20 | "lowercase", |
| 21 | "asciifolding" | 21 | "asciifolding" |
| @@ -58,8 +58,8 @@ | @@ -58,8 +58,8 @@ | ||
| 58 | "properties": { | 58 | "properties": { |
| 59 | "zh": { | 59 | "zh": { |
| 60 | "type": "text", | 60 | "type": "text", |
| 61 | - "analyzer": "index_ansj", | ||
| 62 | - "search_analyzer": "query_ansj" | 61 | + "analyzer": "index_ik", |
| 62 | + "search_analyzer": "query_ik" | ||
| 63 | }, | 63 | }, |
| 64 | "en": { | 64 | "en": { |
| 65 | "type": "text", | 65 | "type": "text", |
| @@ -184,8 +184,8 @@ | @@ -184,8 +184,8 @@ | ||
| 184 | "properties": { | 184 | "properties": { |
| 185 | "zh": { | 185 | "zh": { |
| 186 | "type": "text", | 186 | "type": "text", |
| 187 | - "analyzer": "index_ansj", | ||
| 188 | - "search_analyzer": "query_ansj" | 187 | + "analyzer": "index_ik", |
| 188 | + "search_analyzer": "query_ik" | ||
| 189 | }, | 189 | }, |
| 190 | "en": { | 190 | "en": { |
| 191 | "type": "text", | 191 | "type": "text", |
| @@ -310,8 +310,8 @@ | @@ -310,8 +310,8 @@ | ||
| 310 | "properties": { | 310 | "properties": { |
| 311 | "zh": { | 311 | "zh": { |
| 312 | "type": "text", | 312 | "type": "text", |
| 313 | - "analyzer": "index_ansj", | ||
| 314 | - "search_analyzer": "query_ansj" | 313 | + "analyzer": "index_ik", |
| 314 | + "search_analyzer": "query_ik" | ||
| 315 | }, | 315 | }, |
| 316 | "en": { | 316 | "en": { |
| 317 | "type": "text", | 317 | "type": "text", |
| @@ -436,8 +436,8 @@ | @@ -436,8 +436,8 @@ | ||
| 436 | "properties": { | 436 | "properties": { |
| 437 | "zh": { | 437 | "zh": { |
| 438 | "type": "text", | 438 | "type": "text", |
| 439 | - "analyzer": "index_ansj", | ||
| 440 | - "search_analyzer": "query_ansj" | 439 | + "analyzer": "index_ik", |
| 440 | + "search_analyzer": "query_ik" | ||
| 441 | }, | 441 | }, |
| 442 | "en": { | 442 | "en": { |
| 443 | "type": "text", | 443 | "type": "text", |
| @@ -562,8 +562,8 @@ | @@ -562,8 +562,8 @@ | ||
| 562 | "properties": { | 562 | "properties": { |
| 563 | "zh": { | 563 | "zh": { |
| 564 | "type": "text", | 564 | "type": "text", |
| 565 | - "analyzer": "index_ansj", | ||
| 566 | - "search_analyzer": "query_ansj" | 565 | + "analyzer": "index_ik", |
| 566 | + "search_analyzer": "query_ik" | ||
| 567 | }, | 567 | }, |
| 568 | "en": { | 568 | "en": { |
| 569 | "type": "text", | 569 | "type": "text", |
| @@ -688,8 +688,8 @@ | @@ -688,8 +688,8 @@ | ||
| 688 | "properties": { | 688 | "properties": { |
| 689 | "zh": { | 689 | "zh": { |
| 690 | "type": "text", | 690 | "type": "text", |
| 691 | - "analyzer": "index_ansj", | ||
| 692 | - "search_analyzer": "query_ansj" | 691 | + "analyzer": "index_ik", |
| 692 | + "search_analyzer": "query_ik" | ||
| 693 | }, | 693 | }, |
| 694 | "en": { | 694 | "en": { |
| 695 | "type": "text", | 695 | "type": "text", |
| @@ -1032,8 +1032,8 @@ | @@ -1032,8 +1032,8 @@ | ||
| 1032 | "properties": { | 1032 | "properties": { |
| 1033 | "zh": { | 1033 | "zh": { |
| 1034 | "type": "text", | 1034 | "type": "text", |
| 1035 | - "analyzer": "index_ansj", | ||
| 1036 | - "search_analyzer": "query_ansj" | 1035 | + "analyzer": "index_ik", |
| 1036 | + "search_analyzer": "query_ik" | ||
| 1037 | }, | 1037 | }, |
| 1038 | "en": { | 1038 | "en": { |
| 1039 | "type": "text", | 1039 | "type": "text", |
| @@ -1158,8 +1158,8 @@ | @@ -1158,8 +1158,8 @@ | ||
| 1158 | "properties": { | 1158 | "properties": { |
| 1159 | "zh": { | 1159 | "zh": { |
| 1160 | "type": "text", | 1160 | "type": "text", |
| 1161 | - "analyzer": "index_ansj", | ||
| 1162 | - "search_analyzer": "query_ansj" | 1161 | + "analyzer": "index_ik", |
| 1162 | + "search_analyzer": "query_ik" | ||
| 1163 | }, | 1163 | }, |
| 1164 | "en": { | 1164 | "en": { |
| 1165 | "type": "text", | 1165 | "type": "text", |