From 430ffe48208ad3f092e365964da3fe742ce8dca7 Mon Sep 17 00:00:00 2001 From: tangwang Date: Tue, 6 Jan 2026 20:20:09 +0800 Subject: [PATCH] 多语言索引调整 --- mappings/search_products.json | 212 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------- 1 file changed, 97 insertions(+), 115 deletions(-) diff --git a/mappings/search_products.json b/mappings/search_products.json index acda2df..105575b 100644 --- a/mappings/search_products.json +++ b/mappings/search_products.json @@ -4,6 +4,24 @@ "number_of_replicas": 0, "refresh_interval": "30s", "analysis": { + "analyzer": { + "index_ansj": { + "type": "custom", + "tokenizer": "standard", + "filter": [ + "lowercase", + "asciifolding" + ] + }, + "query_ansj": { + "type": "custom", + "tokenizer": "standard", + "filter": [ + "lowercase", + "asciifolding" + ] + } + }, "normalizer": { "lowercase": { "type": "custom", @@ -38,6 +56,15 @@ "title": { "type": "object", "properties": { + "zh": { + "type": "text", + "analyzer": "index_ansj", + "search_analyzer": "query_ansj" + }, + "en": { + "type": "text", + "analyzer": "english" + }, "ar": { "type": "text", "analyzer": "arabic" @@ -62,14 +89,6 @@ "type": "text", "analyzer": "catalan" }, - "zh": { - "type": "text", - "analyzer": "icu_analyzer" - }, - "chinese": { - "type": "text", - "analyzer": "chinese" - }, "cjk": { "type": "text", "analyzer": "cjk" @@ -86,10 +105,6 @@ "type": "text", "analyzer": "dutch" }, - "en": { - "type": "text", - "analyzer": "english" - }, "fi": { "type": "text", "analyzer": "finnish" @@ -167,6 +182,15 @@ "qanchors": { "type": "object", "properties": { + "zh": { + "type": "text", + "analyzer": "index_ansj", + "search_analyzer": "query_ansj" + }, + "en": { + "type": "text", + "analyzer": "english" + }, "ar": { "type": "text", "analyzer": "arabic" @@ -191,14 +215,6 @@ "type": "text", "analyzer": "catalan" }, - "zh": { - "type": "text", - "analyzer": "icu_analyzer" - }, - "chinese": { - "type": "text", - "analyzer": "chinese" - }, "cjk": { "type": "text", "analyzer": "cjk" @@ -215,10 +231,6 @@ "type": "text", "analyzer": "dutch" }, - "en": { - "type": "text", - "analyzer": "english" - }, "fi": { "type": "text", "analyzer": "finnish" @@ -296,6 +308,15 @@ "keywords": { "type": "object", "properties": { + "zh": { + "type": "text", + "analyzer": "index_ansj", + "search_analyzer": "query_ansj" + }, + "en": { + "type": "text", + "analyzer": "english" + }, "ar": { "type": "text", "analyzer": "arabic" @@ -320,14 +341,6 @@ "type": "text", "analyzer": "catalan" }, - "zh": { - "type": "text", - "analyzer": "icu_analyzer" - }, - "chinese": { - "type": "text", - "analyzer": "chinese" - }, "cjk": { "type": "text", "analyzer": "cjk" @@ -344,10 +357,6 @@ "type": "text", "analyzer": "dutch" }, - "en": { - "type": "text", - "analyzer": "english" - }, "fi": { "type": "text", "analyzer": "finnish" @@ -425,6 +434,15 @@ "brief": { "type": "object", "properties": { + "zh": { + "type": "text", + "analyzer": "index_ansj", + "search_analyzer": "query_ansj" + }, + "en": { + "type": "text", + "analyzer": "english" + }, "ar": { "type": "text", "analyzer": "arabic" @@ -449,14 +467,6 @@ "type": "text", "analyzer": "catalan" }, - "zh": { - "type": "text", - "analyzer": "icu_analyzer" - }, - "chinese": { - "type": "text", - "analyzer": "chinese" - }, "cjk": { "type": "text", "analyzer": "cjk" @@ -473,10 +483,6 @@ "type": "text", "analyzer": "dutch" }, - "en": { - "type": "text", - "analyzer": "english" - }, "fi": { "type": "text", "analyzer": "finnish" @@ -554,6 +560,15 @@ "description": { "type": "object", "properties": { + "zh": { + "type": "text", + "analyzer": "index_ansj", + "search_analyzer": "query_ansj" + }, + "en": { + "type": "text", + "analyzer": "english" + }, "ar": { "type": "text", "analyzer": "arabic" @@ -578,14 +593,6 @@ "type": "text", "analyzer": "catalan" }, - "zh": { - "type": "text", - "analyzer": "icu_analyzer" - }, - "chinese": { - "type": "text", - "analyzer": "chinese" - }, "cjk": { "type": "text", "analyzer": "cjk" @@ -602,10 +609,6 @@ "type": "text", "analyzer": "dutch" }, - "en": { - "type": "text", - "analyzer": "english" - }, "fi": { "type": "text", "analyzer": "finnish" @@ -683,6 +686,21 @@ "vendor": { "type": "object", "properties": { + "zh": { + "type": "text", + "analyzer": "index_ansj", + "search_analyzer": "query_ansj" + }, + "en": { + "type": "text", + "analyzer": "english", + "fields": { + "keyword": { + "type": "keyword", + "normalizer": "lowercase" + } + } + }, "ar": { "type": "text", "analyzer": "arabic", @@ -743,26 +761,6 @@ } } }, - "zh": { - "type": "text", - "analyzer": "icu_analyzer", - "fields": { - "keyword": { - "type": "keyword", - "normalizer": "lowercase" - } - } - }, - "chinese": { - "type": "text", - "analyzer": "chinese", - "fields": { - "keyword": { - "type": "keyword", - "normalizer": "lowercase" - } - } - }, "cjk": { "type": "text", "analyzer": "cjk", @@ -803,16 +801,6 @@ } } }, - "en": { - "type": "text", - "analyzer": "english", - "fields": { - "keyword": { - "type": "keyword", - "normalizer": "lowercase" - } - } - }, "fi": { "type": "text", "analyzer": "finnish", @@ -1039,6 +1027,15 @@ "category_path": { "type": "object", "properties": { + "zh": { + "type": "text", + "analyzer": "index_ansj", + "search_analyzer": "query_ansj" + }, + "en": { + "type": "text", + "analyzer": "english" + }, "ar": { "type": "text", "analyzer": "arabic" @@ -1063,14 +1060,6 @@ "type": "text", "analyzer": "catalan" }, - "zh": { - "type": "text", - "analyzer": "icu_analyzer" - }, - "chinese": { - "type": "text", - "analyzer": "chinese" - }, "cjk": { "type": "text", "analyzer": "cjk" @@ -1087,10 +1076,6 @@ "type": "text", "analyzer": "dutch" }, - "en": { - "type": "text", - "analyzer": "english" - }, "fi": { "type": "text", "analyzer": "finnish" @@ -1168,6 +1153,15 @@ "category_name_text": { "type": "object", "properties": { + "zh": { + "type": "text", + "analyzer": "index_ansj", + "search_analyzer": "query_ansj" + }, + "en": { + "type": "text", + "analyzer": "english" + }, "ar": { "type": "text", "analyzer": "arabic" @@ -1192,14 +1186,6 @@ "type": "text", "analyzer": "catalan" }, - "zh": { - "type": "text", - "analyzer": "icu_analyzer" - }, - "chinese": { - "type": "text", - "analyzer": "chinese" - }, "cjk": { "type": "text", "analyzer": "cjk" @@ -1216,10 +1202,6 @@ "type": "text", "analyzer": "dutch" }, - "en": { - "type": "text", - "analyzer": "english" - }, "fi": { "type": "text", "analyzer": "finnish" @@ -1409,4 +1391,4 @@ } } } -} +} \ No newline at end of file -- libgit2 0.21.2