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 4 "number_of_replicas": 0,
5 5 "refresh_interval": "30s",
6 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 25 "normalizer": {
8 26 "lowercase": {
9 27 "type": "custom",
... ... @@ -38,6 +56,15 @@
38 56 "title": {
39 57 "type": "object",
40 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 68 "ar": {
42 69 "type": "text",
43 70 "analyzer": "arabic"
... ... @@ -62,14 +89,6 @@
62 89 "type": "text",
63 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 92 "cjk": {
74 93 "type": "text",
75 94 "analyzer": "cjk"
... ... @@ -86,10 +105,6 @@
86 105 "type": "text",
87 106 "analyzer": "dutch"
88 107 },
89   - "en": {
90   - "type": "text",
91   - "analyzer": "english"
92   - },
93 108 "fi": {
94 109 "type": "text",
95 110 "analyzer": "finnish"
... ... @@ -167,6 +182,15 @@
167 182 "qanchors": {
168 183 "type": "object",
169 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 194 "ar": {
171 195 "type": "text",
172 196 "analyzer": "arabic"
... ... @@ -191,14 +215,6 @@
191 215 "type": "text",
192 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 218 "cjk": {
203 219 "type": "text",
204 220 "analyzer": "cjk"
... ... @@ -215,10 +231,6 @@
215 231 "type": "text",
216 232 "analyzer": "dutch"
217 233 },
218   - "en": {
219   - "type": "text",
220   - "analyzer": "english"
221   - },
222 234 "fi": {
223 235 "type": "text",
224 236 "analyzer": "finnish"
... ... @@ -296,6 +308,15 @@
296 308 "keywords": {
297 309 "type": "object",
298 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 320 "ar": {
300 321 "type": "text",
301 322 "analyzer": "arabic"
... ... @@ -320,14 +341,6 @@
320 341 "type": "text",
321 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 344 "cjk": {
332 345 "type": "text",
333 346 "analyzer": "cjk"
... ... @@ -344,10 +357,6 @@
344 357 "type": "text",
345 358 "analyzer": "dutch"
346 359 },
347   - "en": {
348   - "type": "text",
349   - "analyzer": "english"
350   - },
351 360 "fi": {
352 361 "type": "text",
353 362 "analyzer": "finnish"
... ... @@ -425,6 +434,15 @@
425 434 "brief": {
426 435 "type": "object",
427 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 446 "ar": {
429 447 "type": "text",
430 448 "analyzer": "arabic"
... ... @@ -449,14 +467,6 @@
449 467 "type": "text",
450 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 470 "cjk": {
461 471 "type": "text",
462 472 "analyzer": "cjk"
... ... @@ -473,10 +483,6 @@
473 483 "type": "text",
474 484 "analyzer": "dutch"
475 485 },
476   - "en": {
477   - "type": "text",
478   - "analyzer": "english"
479   - },
480 486 "fi": {
481 487 "type": "text",
482 488 "analyzer": "finnish"
... ... @@ -554,6 +560,15 @@
554 560 "description": {
555 561 "type": "object",
556 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 572 "ar": {
558 573 "type": "text",
559 574 "analyzer": "arabic"
... ... @@ -578,14 +593,6 @@
578 593 "type": "text",
579 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 596 "cjk": {
590 597 "type": "text",
591 598 "analyzer": "cjk"
... ... @@ -602,10 +609,6 @@
602 609 "type": "text",
603 610 "analyzer": "dutch"
604 611 },
605   - "en": {
606   - "type": "text",
607   - "analyzer": "english"
608   - },
609 612 "fi": {
610 613 "type": "text",
611 614 "analyzer": "finnish"
... ... @@ -683,6 +686,21 @@
683 686 "vendor": {
684 687 "type": "object",
685 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 704 "ar": {
687 705 "type": "text",
688 706 "analyzer": "arabic",
... ... @@ -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 764 "cjk": {
767 765 "type": "text",
768 766 "analyzer": "cjk",
... ... @@ -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 804 "fi": {
817 805 "type": "text",
818 806 "analyzer": "finnish",
... ... @@ -1039,6 +1027,15 @@
1039 1027 "category_path": {
1040 1028 "type": "object",
1041 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 1039 "ar": {
1043 1040 "type": "text",
1044 1041 "analyzer": "arabic"
... ... @@ -1063,14 +1060,6 @@
1063 1060 "type": "text",
1064 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 1063 "cjk": {
1075 1064 "type": "text",
1076 1065 "analyzer": "cjk"
... ... @@ -1087,10 +1076,6 @@
1087 1076 "type": "text",
1088 1077 "analyzer": "dutch"
1089 1078 },
1090   - "en": {
1091   - "type": "text",
1092   - "analyzer": "english"
1093   - },
1094 1079 "fi": {
1095 1080 "type": "text",
1096 1081 "analyzer": "finnish"
... ... @@ -1168,6 +1153,15 @@
1168 1153 "category_name_text": {
1169 1154 "type": "object",
1170 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 1165 "ar": {
1172 1166 "type": "text",
1173 1167 "analyzer": "arabic"
... ... @@ -1192,14 +1186,6 @@
1192 1186 "type": "text",
1193 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 1189 "cjk": {
1204 1190 "type": "text",
1205 1191 "analyzer": "cjk"
... ... @@ -1216,10 +1202,6 @@
1216 1202 "type": "text",
1217 1203 "analyzer": "dutch"
1218 1204 },
1219   - "en": {
1220   - "type": "text",
1221   - "analyzer": "english"
1222   - },
1223 1205 "fi": {
1224 1206 "type": "text",
1225 1207 "analyzer": "finnish"
... ... @@ -1409,4 +1391,4 @@
1409 1391 }
1410 1392 }
1411 1393 }
1412 1394 -}
  1395 +}
1413 1396 \ No newline at end of file
... ...