Commit 430ffe48208ad3f092e365964da3fe742ce8dca7

Authored by tangwang
1 parent 2739b281

多语言索引调整

Showing 1 changed file with 97 additions and 115 deletions   Show diff stats
mappings/search_products.json
@@ -4,6 +4,24 @@ @@ -4,6 +4,24 @@
4 "number_of_replicas": 0, 4 "number_of_replicas": 0,
5 "refresh_interval": "30s", 5 "refresh_interval": "30s",
6 "analysis": { 6 "analysis": {
  7 + "analyzer": {
  8 + "index_ansj": {
  9 + "type": "custom",
  10 + "tokenizer": "standard",
  11 + "filter": [
  12 + "lowercase",
  13 + "asciifolding"
  14 + ]
  15 + },
  16 + "query_ansj": {
  17 + "type": "custom",
  18 + "tokenizer": "standard",
  19 + "filter": [
  20 + "lowercase",
  21 + "asciifolding"
  22 + ]
  23 + }
  24 + },
7 "normalizer": { 25 "normalizer": {
8 "lowercase": { 26 "lowercase": {
9 "type": "custom", 27 "type": "custom",
@@ -38,6 +56,15 @@ @@ -38,6 +56,15 @@
38 "title": { 56 "title": {
39 "type": "object", 57 "type": "object",
40 "properties": { 58 "properties": {
  59 + "zh": {
  60 + "type": "text",
  61 + "analyzer": "index_ansj",
  62 + "search_analyzer": "query_ansj"
  63 + },
  64 + "en": {
  65 + "type": "text",
  66 + "analyzer": "english"
  67 + },
41 "ar": { 68 "ar": {
42 "type": "text", 69 "type": "text",
43 "analyzer": "arabic" 70 "analyzer": "arabic"
@@ -62,14 +89,6 @@ @@ -62,14 +89,6 @@
62 "type": "text", 89 "type": "text",
63 "analyzer": "catalan" 90 "analyzer": "catalan"
64 }, 91 },
65 - "zh": {  
66 - "type": "text",  
67 - "analyzer": "icu_analyzer"  
68 - },  
69 - "chinese": {  
70 - "type": "text",  
71 - "analyzer": "chinese"  
72 - },  
73 "cjk": { 92 "cjk": {
74 "type": "text", 93 "type": "text",
75 "analyzer": "cjk" 94 "analyzer": "cjk"
@@ -86,10 +105,6 @@ @@ -86,10 +105,6 @@
86 "type": "text", 105 "type": "text",
87 "analyzer": "dutch" 106 "analyzer": "dutch"
88 }, 107 },
89 - "en": {  
90 - "type": "text",  
91 - "analyzer": "english"  
92 - },  
93 "fi": { 108 "fi": {
94 "type": "text", 109 "type": "text",
95 "analyzer": "finnish" 110 "analyzer": "finnish"
@@ -167,6 +182,15 @@ @@ -167,6 +182,15 @@
167 "qanchors": { 182 "qanchors": {
168 "type": "object", 183 "type": "object",
169 "properties": { 184 "properties": {
  185 + "zh": {
  186 + "type": "text",
  187 + "analyzer": "index_ansj",
  188 + "search_analyzer": "query_ansj"
  189 + },
  190 + "en": {
  191 + "type": "text",
  192 + "analyzer": "english"
  193 + },
170 "ar": { 194 "ar": {
171 "type": "text", 195 "type": "text",
172 "analyzer": "arabic" 196 "analyzer": "arabic"
@@ -191,14 +215,6 @@ @@ -191,14 +215,6 @@
191 "type": "text", 215 "type": "text",
192 "analyzer": "catalan" 216 "analyzer": "catalan"
193 }, 217 },
194 - "zh": {  
195 - "type": "text",  
196 - "analyzer": "icu_analyzer"  
197 - },  
198 - "chinese": {  
199 - "type": "text",  
200 - "analyzer": "chinese"  
201 - },  
202 "cjk": { 218 "cjk": {
203 "type": "text", 219 "type": "text",
204 "analyzer": "cjk" 220 "analyzer": "cjk"
@@ -215,10 +231,6 @@ @@ -215,10 +231,6 @@
215 "type": "text", 231 "type": "text",
216 "analyzer": "dutch" 232 "analyzer": "dutch"
217 }, 233 },
218 - "en": {  
219 - "type": "text",  
220 - "analyzer": "english"  
221 - },  
222 "fi": { 234 "fi": {
223 "type": "text", 235 "type": "text",
224 "analyzer": "finnish" 236 "analyzer": "finnish"
@@ -296,6 +308,15 @@ @@ -296,6 +308,15 @@
296 "keywords": { 308 "keywords": {
297 "type": "object", 309 "type": "object",
298 "properties": { 310 "properties": {
  311 + "zh": {
  312 + "type": "text",
  313 + "analyzer": "index_ansj",
  314 + "search_analyzer": "query_ansj"
  315 + },
  316 + "en": {
  317 + "type": "text",
  318 + "analyzer": "english"
  319 + },
299 "ar": { 320 "ar": {
300 "type": "text", 321 "type": "text",
301 "analyzer": "arabic" 322 "analyzer": "arabic"
@@ -320,14 +341,6 @@ @@ -320,14 +341,6 @@
320 "type": "text", 341 "type": "text",
321 "analyzer": "catalan" 342 "analyzer": "catalan"
322 }, 343 },
323 - "zh": {  
324 - "type": "text",  
325 - "analyzer": "icu_analyzer"  
326 - },  
327 - "chinese": {  
328 - "type": "text",  
329 - "analyzer": "chinese"  
330 - },  
331 "cjk": { 344 "cjk": {
332 "type": "text", 345 "type": "text",
333 "analyzer": "cjk" 346 "analyzer": "cjk"
@@ -344,10 +357,6 @@ @@ -344,10 +357,6 @@
344 "type": "text", 357 "type": "text",
345 "analyzer": "dutch" 358 "analyzer": "dutch"
346 }, 359 },
347 - "en": {  
348 - "type": "text",  
349 - "analyzer": "english"  
350 - },  
351 "fi": { 360 "fi": {
352 "type": "text", 361 "type": "text",
353 "analyzer": "finnish" 362 "analyzer": "finnish"
@@ -425,6 +434,15 @@ @@ -425,6 +434,15 @@
425 "brief": { 434 "brief": {
426 "type": "object", 435 "type": "object",
427 "properties": { 436 "properties": {
  437 + "zh": {
  438 + "type": "text",
  439 + "analyzer": "index_ansj",
  440 + "search_analyzer": "query_ansj"
  441 + },
  442 + "en": {
  443 + "type": "text",
  444 + "analyzer": "english"
  445 + },
428 "ar": { 446 "ar": {
429 "type": "text", 447 "type": "text",
430 "analyzer": "arabic" 448 "analyzer": "arabic"
@@ -449,14 +467,6 @@ @@ -449,14 +467,6 @@
449 "type": "text", 467 "type": "text",
450 "analyzer": "catalan" 468 "analyzer": "catalan"
451 }, 469 },
452 - "zh": {  
453 - "type": "text",  
454 - "analyzer": "icu_analyzer"  
455 - },  
456 - "chinese": {  
457 - "type": "text",  
458 - "analyzer": "chinese"  
459 - },  
460 "cjk": { 470 "cjk": {
461 "type": "text", 471 "type": "text",
462 "analyzer": "cjk" 472 "analyzer": "cjk"
@@ -473,10 +483,6 @@ @@ -473,10 +483,6 @@
473 "type": "text", 483 "type": "text",
474 "analyzer": "dutch" 484 "analyzer": "dutch"
475 }, 485 },
476 - "en": {  
477 - "type": "text",  
478 - "analyzer": "english"  
479 - },  
480 "fi": { 486 "fi": {
481 "type": "text", 487 "type": "text",
482 "analyzer": "finnish" 488 "analyzer": "finnish"
@@ -554,6 +560,15 @@ @@ -554,6 +560,15 @@
554 "description": { 560 "description": {
555 "type": "object", 561 "type": "object",
556 "properties": { 562 "properties": {
  563 + "zh": {
  564 + "type": "text",
  565 + "analyzer": "index_ansj",
  566 + "search_analyzer": "query_ansj"
  567 + },
  568 + "en": {
  569 + "type": "text",
  570 + "analyzer": "english"
  571 + },
557 "ar": { 572 "ar": {
558 "type": "text", 573 "type": "text",
559 "analyzer": "arabic" 574 "analyzer": "arabic"
@@ -578,14 +593,6 @@ @@ -578,14 +593,6 @@
578 "type": "text", 593 "type": "text",
579 "analyzer": "catalan" 594 "analyzer": "catalan"
580 }, 595 },
581 - "zh": {  
582 - "type": "text",  
583 - "analyzer": "icu_analyzer"  
584 - },  
585 - "chinese": {  
586 - "type": "text",  
587 - "analyzer": "chinese"  
588 - },  
589 "cjk": { 596 "cjk": {
590 "type": "text", 597 "type": "text",
591 "analyzer": "cjk" 598 "analyzer": "cjk"
@@ -602,10 +609,6 @@ @@ -602,10 +609,6 @@
602 "type": "text", 609 "type": "text",
603 "analyzer": "dutch" 610 "analyzer": "dutch"
604 }, 611 },
605 - "en": {  
606 - "type": "text",  
607 - "analyzer": "english"  
608 - },  
609 "fi": { 612 "fi": {
610 "type": "text", 613 "type": "text",
611 "analyzer": "finnish" 614 "analyzer": "finnish"
@@ -683,6 +686,21 @@ @@ -683,6 +686,21 @@
683 "vendor": { 686 "vendor": {
684 "type": "object", 687 "type": "object",
685 "properties": { 688 "properties": {
  689 + "zh": {
  690 + "type": "text",
  691 + "analyzer": "index_ansj",
  692 + "search_analyzer": "query_ansj"
  693 + },
  694 + "en": {
  695 + "type": "text",
  696 + "analyzer": "english",
  697 + "fields": {
  698 + "keyword": {
  699 + "type": "keyword",
  700 + "normalizer": "lowercase"
  701 + }
  702 + }
  703 + },
686 "ar": { 704 "ar": {
687 "type": "text", 705 "type": "text",
688 "analyzer": "arabic", 706 "analyzer": "arabic",
@@ -743,26 +761,6 @@ @@ -743,26 +761,6 @@
743 } 761 }
744 } 762 }
745 }, 763 },
746 - "zh": {  
747 - "type": "text",  
748 - "analyzer": "icu_analyzer",  
749 - "fields": {  
750 - "keyword": {  
751 - "type": "keyword",  
752 - "normalizer": "lowercase"  
753 - }  
754 - }  
755 - },  
756 - "chinese": {  
757 - "type": "text",  
758 - "analyzer": "chinese",  
759 - "fields": {  
760 - "keyword": {  
761 - "type": "keyword",  
762 - "normalizer": "lowercase"  
763 - }  
764 - }  
765 - },  
766 "cjk": { 764 "cjk": {
767 "type": "text", 765 "type": "text",
768 "analyzer": "cjk", 766 "analyzer": "cjk",
@@ -803,16 +801,6 @@ @@ -803,16 +801,6 @@
803 } 801 }
804 } 802 }
805 }, 803 },
806 - "en": {  
807 - "type": "text",  
808 - "analyzer": "english",  
809 - "fields": {  
810 - "keyword": {  
811 - "type": "keyword",  
812 - "normalizer": "lowercase"  
813 - }  
814 - }  
815 - },  
816 "fi": { 804 "fi": {
817 "type": "text", 805 "type": "text",
818 "analyzer": "finnish", 806 "analyzer": "finnish",
@@ -1039,6 +1027,15 @@ @@ -1039,6 +1027,15 @@
1039 "category_path": { 1027 "category_path": {
1040 "type": "object", 1028 "type": "object",
1041 "properties": { 1029 "properties": {
  1030 + "zh": {
  1031 + "type": "text",
  1032 + "analyzer": "index_ansj",
  1033 + "search_analyzer": "query_ansj"
  1034 + },
  1035 + "en": {
  1036 + "type": "text",
  1037 + "analyzer": "english"
  1038 + },
1042 "ar": { 1039 "ar": {
1043 "type": "text", 1040 "type": "text",
1044 "analyzer": "arabic" 1041 "analyzer": "arabic"
@@ -1063,14 +1060,6 @@ @@ -1063,14 +1060,6 @@
1063 "type": "text", 1060 "type": "text",
1064 "analyzer": "catalan" 1061 "analyzer": "catalan"
1065 }, 1062 },
1066 - "zh": {  
1067 - "type": "text",  
1068 - "analyzer": "icu_analyzer"  
1069 - },  
1070 - "chinese": {  
1071 - "type": "text",  
1072 - "analyzer": "chinese"  
1073 - },  
1074 "cjk": { 1063 "cjk": {
1075 "type": "text", 1064 "type": "text",
1076 "analyzer": "cjk" 1065 "analyzer": "cjk"
@@ -1087,10 +1076,6 @@ @@ -1087,10 +1076,6 @@
1087 "type": "text", 1076 "type": "text",
1088 "analyzer": "dutch" 1077 "analyzer": "dutch"
1089 }, 1078 },
1090 - "en": {  
1091 - "type": "text",  
1092 - "analyzer": "english"  
1093 - },  
1094 "fi": { 1079 "fi": {
1095 "type": "text", 1080 "type": "text",
1096 "analyzer": "finnish" 1081 "analyzer": "finnish"
@@ -1168,6 +1153,15 @@ @@ -1168,6 +1153,15 @@
1168 "category_name_text": { 1153 "category_name_text": {
1169 "type": "object", 1154 "type": "object",
1170 "properties": { 1155 "properties": {
  1156 + "zh": {
  1157 + "type": "text",
  1158 + "analyzer": "index_ansj",
  1159 + "search_analyzer": "query_ansj"
  1160 + },
  1161 + "en": {
  1162 + "type": "text",
  1163 + "analyzer": "english"
  1164 + },
1171 "ar": { 1165 "ar": {
1172 "type": "text", 1166 "type": "text",
1173 "analyzer": "arabic" 1167 "analyzer": "arabic"
@@ -1192,14 +1186,6 @@ @@ -1192,14 +1186,6 @@
1192 "type": "text", 1186 "type": "text",
1193 "analyzer": "catalan" 1187 "analyzer": "catalan"
1194 }, 1188 },
1195 - "zh": {  
1196 - "type": "text",  
1197 - "analyzer": "icu_analyzer"  
1198 - },  
1199 - "chinese": {  
1200 - "type": "text",  
1201 - "analyzer": "chinese"  
1202 - },  
1203 "cjk": { 1189 "cjk": {
1204 "type": "text", 1190 "type": "text",
1205 "analyzer": "cjk" 1191 "analyzer": "cjk"
@@ -1216,10 +1202,6 @@ @@ -1216,10 +1202,6 @@
1216 "type": "text", 1202 "type": "text",
1217 "analyzer": "dutch" 1203 "analyzer": "dutch"
1218 }, 1204 },
1219 - "en": {  
1220 - "type": "text",  
1221 - "analyzer": "english"  
1222 - },  
1223 "fi": { 1205 "fi": {
1224 "type": "text", 1206 "type": "text",
1225 "analyzer": "finnish" 1207 "analyzer": "finnish"
@@ -1409,4 +1391,4 @@ @@ -1409,4 +1391,4 @@
1409 } 1391 }
1410 } 1392 }
1411 } 1393 }
1412 -} 1394 -}
  1395 +}
1413 \ No newline at end of file 1396 \ No newline at end of file