1 GET /_cat/indices
2
3
4 GET seojoindata/_search
5 {
6 "track_total_hits": true,
7 "size": 20,
8 "query": {
9 "match_all": {}
10 },
11 "_source": {
12 "includes": ["articleId","article_index","article_en"]
13 },
14 "sort": [
15 {
16 "article_index": {
17 "order": "desc"
18 }
19 }
20 ]
21 }
22
23
24 GET seokeytagsdata/_mapping
25
26
27
28 GET seokeytagsdata/_search
29 {
30 "query": {
31 "term": {
32 "corekwdId": {
33 "value": "2183894"
34 }
35 }
36 }
37 }
38
39 GET seokeytagsdata_0818/_search
40 {
41 "track_total_hits": true,
42 "query": {
43 "bool": {
44 "must_not": [
45 {
46 "exists": {
47 "field": "tag_key_url"
48 }
49 }
50 ]
51 }
52 }
53 }
54
55 GET seokeytagsdata_0818/_search
56 {
57 "track_total_hits": true,
58 "query": {
59 "match_all": {}
60 }
61 }
62
63
64
65 GET seokeytagsdata/_search
66 {
67 "track_total_hits": true,
68 "query": {
69 "match_all": {}
70 }
71 }
72
73 GET seojoindata/_search
74 {
75 "size": 0,
76 "aggs": {
77 "group_by_category": {
78 "terms": {
79 "field": "seo_category_type.keyword",
80 "size": 50
81 },
82 "aggs": {
83 "group_by_part": {
84 "terms": {
85 "field": "seo_part_name.keyword",
86 "size": 100
87 },
88 "aggs": {
89 "group_by_part_url": {
90 "terms": {
91 "field": "seo_part_url",
92 "size": 50
93 }
94 },
95 "group_by_part_id": {
96 "terms": {
97 "field": "seo_part_Id.keyword",
98 "size": 50
99 }
100 }
101 }
102 },
103 "group_by_category_url": {
104 "terms": {
105 "field": "seo_category_url",
106 "size": 50
107 }
108 },
109 "group_by_category_id": {
110 "terms": {
111 "field": "seo_category_Id.keyword",
112 "size": 50
113 }
114 }
115 }
116 }
117 }
118 }
119
120 GET seojoindata/_search
121 {
122 "track_total_hits": true,
123 "size": 40,
124 "query": {
125 "bool": {
126 "should": [
127 {
128 "term": {
129 "seo_part_Id.keyword": {
130 "value": "seoc14"
131 }
132 }
133 },
134 {
135 "term": {
136 "seo_category_Id.keyword": {
137 "value": "seoc14"
138 }
139 }
140 }
141 ]
142 }
143 },
144 "sort": [
145 {
146 "pubdate": {
147 "order": "desc"
148 }
149 }
150 ],
151 "_source": [
152 "coreKeyWord","otherkwdlist"
153 ]
154 }
155
156 {
157 "track_total_hits": true,
158 "size": 10000,
159 "query": {
160 "wildcard": {
161 "pubdate": {
162 "value": "2020-06*"
163 }
164 }
165 },
166 "_source": ["article_url","pubdate"]
167 }
168
169
170
171 GET seojoindata/_mapping
172
173 GET seojoindata/_count
174
175
176 GET seojoindata/_search
177 {
178 "track_total_hits": true,
179 "size": 500,
180 "query": {
181 "match_all": {}
182 },
183 "_source": {
184 "includes": [
185 "coreKeyWord",
186 "article_url",
187 "title_en",
188 "articleId",
189 "fullurl"
190 ]
191 }
192 }
193
194 GET seojoindata/_search
195 {
196 "size": 11,
197 "query": {
198 "bool": {
199 "must": [
200 {
201 "exists": {
202 "field": "taglist.tagId"
203 }
204 },
205 {
206 "exists": {
207 "field": "article_en"
208 }
209 },
210 {
211 "nested": {
212 "path": "coreKeyWord",
213 "query": {
214 "exists": {
215 "field": "coreKeyWord.corekwdId"
216 }
217 }
218 }
219 },
220 {
221 "match": {
222 "title_en": {
223 "query": "Experts talk about the phosphating process before the primer is applied",
224 "analyzer": "english",
225 "minimum_should_match": "50%"
226 }
227 }
228 }
229 ],
230 "must_not": [
231 {
232 "term": {
233 "title_en.raw": {
234 "value": "Experts talk about the phosphating process before the primer is applied"
235 }
236 }
237 }
238 ]
239 }
240 },
241 "_source": {
242 "includes": [
243 "articleId",
244 "article_url",
245 "title_en",
246 "pubdate",
247 "clickCount"
248 ]
249 }
250 }
251
252
253 GET seojoindata/_search
254 {
255 "track_total_hits": true,
256 "size": 0,
257 "query": {
258 "term": {
259 "trans_date": {
260 "value": "2020-07-28"
261 }
262 }
263 }
264 }
265
266
267
268
269 GET seojoindata/_search
270 {
271 "size": 1000,
272 "query": {
273 "term": {
274 "trans_date": {
275 "value": "2020-07-28"
276 }
277 }
278 },
279 "_source": ["title_en","article_en"]
280 }
281
282
283 GET seojoindata/_search
284 {
285 "query": {
286 "term": {
287 "title_en.raw": {
288 "value": "FDA approved the first precise therapy for gastrointestinal stromal tumor"
289 }
290 }
291 },
292 "_source": ["title_en","article_en"]
293 }
294
295
296 GET seojoindata/_search
297 {
298 "query": {
299 "term": {
300 "fullurl": {
301 "value": "https://news.yaozh.com/archive/28331.html"
302 }
303 }
304 },
305 "_source": ["article_en","fullurl","title_en","title"]
306 }
307
308 GET seojoindata/_search
309 {
310 "track_total_hits": true,
311 "size": 1000,
312 "query": {
313 "term": {
314 "endSource": {
315 "value": "www.x-mol.com"
316 }
317 }
318 },
319 "_source": ["article_en","fullurl","endSource"]
320 }
321
322 GET seojoindata/_search
323 {
324 "query": {
325 "term": {
326 "articleId": {
327 "value": "83548"
328 }
329 }
330 }
331 }
332
333 GET seojoindata/_search
334 {
335 "track_total_hits": true,
336 "query": {
337 "bool": {
338 "must": [
339 {
340 "term": {
341 "is_valid": {
342 "value": "1"
343 }
344 }
345 },
346 {
347 "term": {
348 "seo_part_Id.keyword": {
349 "value": "seoc2116"
350 }
351 }
352 }
353 ]
354 }
355 },
356 "_source": [
357
358 "article_index",
359
360 "seo_part_name",
361 "seo_part_url"
362 ]
363 }
364
365 GET seojoindata/_search
366 {
367 "query": {
368 "match_all": {}
369 },
370 "_source": [
371 "seo_part_Id",
372 "seo_part_name",
373 "seo_part_url"
374 ]
375 }
376
377 GET seojoindata/_search
378 {
379 "query": {
380 "bool": {
381 "must": [
382 {
383 "exists": {
384 "field": "taglist.tagId"
385 }
386 },
387 {
388 "exists": {
389 "field": "article_en"
390 }
391 },
392 {
393 "term": {
394 "articleId": {
395 "value": "5eba4dee8fdca9edee8882b8"
396 }
397 }
398 },
399 {
400 "nested": {
401 "path": "coreKeyWord",
402 "query": {
403 "bool": {
404 "must": [
405 {
406 "exists": {
407 "field": "coreKeyWord.corekwdId"
408 }
409 }
410 ]
411 }
412 }
413 }
414 }
415 ]
416 }
417 },
418 "_source": {
419 "includes": [
420 "coreKeyWord",
421 "seo_part_Id",
422 "seo_part_name",
423 "seo_part_url"
424 ]
425 }
426 }
427
428 GET seojoindata/_search
429 {
430 "track_total_hits": true,
431 "size": 0,
432 "query": {
433 "bool": {
434 "must": [
435 {
436 "exists": {
437 "field": "article_en"
438 }
439 },
440 {
441 "term": {
442 "weekday.keyword": {
443 "value": "Sunday"
444 }
445 }
446 }
447 ]
448 }
449 },
450 "aggs": {
451 "min_max_kId": {
452 "stats": {
453 "field": "article_index"
454 }
455 }
456 }
457 }
458
459 GET seojoindata/_search
460 {
461 "track_total_hits": true,
462 "from":1790,
463 "size": 100,
464 "query": {
465 "bool": {
466 "must": [
467 {
468 "exists": {
469 "field": "article_en"
470 }
471 },
472 {
473 "term": {
474 "weekday.keyword": {
475 "value": "Sunday"
476 }
477 }
478 }
479 ]
480 }
481 },
482 "sort": [
483 {
484 "article_index": {
485 "order": "asc"
486 }
487 }
488 ],
489 "_source": [
490 "article_url",
491 "title_en",
492 "weekday",
493 "article_index",
494 "pubdate"
495 ]
496 }
497
498
499 GET seojoindata/_search
500 {
501 "track_total_hits": true,
502 "size": 100,
503 "query": {
504 "bool": {
505 "must": [
506 {
507 "exists": {
508 "field": "article_en"
509 }
510 },
511 {
512 "term": {
513 "weekday.keyword": {
514 "value": "Sunday"
515 }
516 }
517 }
518 ]
519 }
520 },
521 "search_after": [0],
522 "sort": [
523 {
524 "article_index": {
525 "order": "asc"
526 }
527 }
528 ],
529 "_source": [
530 "article_url",
531 "title_en",
532 "weekday",
533 "article_index",
534 "pubdate"
535 ]
536 }
537
538
539 # 获取二级分类的关键词列表
540 GET seojoindata/_search
541 {
542 "track_total_hits": true,
543 "size": 0,
544 "query": {
545 "bool": {
546 "must": [
547 {
548 "exists": {
549 "field": "article_en"
550 }
551 },
552 {
553 "term": {
554 "seo_part_Id.keyword": {
555 "value": "seoc1111"
556 }
557 }
558 }
559 ]
560 }
561 },
562 "aggs": {
563 "min_max_kId": {
564 "stats": {
565 "field": "article_index"
566 }
567 }
568 }
569 }
570
571
572 # 开始 35407
573 # 今天 52491
574 GET seojoindata/_search
575 {
576 "track_total_hits": true,
577 "size": 0,
578 "query": {
579 "bool": {
580 "must": [
581 {
582 "term": {
583 "is_valid": {
584 "value": 1
585 }
586 }
587 },
588 {
589 "exists": {
590 "field": "article_en"
591 }
592 },
593 {
594 "exists": {
595 "field": "article_summery"
596 }
597 },
598 {
599 "exists": {
600 "field": "seo_category_Id"
601 }
602 }
603 ]
604 }
605 }
606 }
607
608 GET seojoindata/_count
609
610
611 GET seojoindata/_search
612 {
613 "query": {
614 "match_all": {}
615 },
616 "_source": {
617 "excludes": ["article_summery","title_en","article_en","taglist"]
618 }
619 }
620
621
622
623 GET seojoindata/_search
624 {
625 "size": 2,
626 "query": {
627 "bool": {
628 "must": [
629 {
630 "term": {
631 "is_valid": {
632 "value": 1
633 }
634 }
635 },
636 {
637 "term": {
638 "seo_part_Id.keyword": {
639 "value": "seoc11_2"
640 }
641 }
642 }
643 ]
644 }
645 },
646 "_source": [
647 "taglist",
648 "seo_category_type",
649 "seo_category_url",
650 "seo_part_name",
651 "seo_part_url"
652 ]
653 }
654
655 # 一级分类下的关键词
656 GET seojoindata/_search
657 {
658 "track_total_hits": true,
659 "size": 100,
660 "query": {
661 "bool": {
662 "must": [
663 {
664 "term": {
665 "is_valid": {
666 "value": "1"
667 }
668 }
669 },
670 {
671 "term": {
672 "seo_category_Id.keyword": {
673 "value": "seoc14"
674 }
675 }
676 }
677 ]
678 }
679 },
680 "sort": [
681 {
682 "article_index": {
683 "order": "asc"
684 }
685 }
686 ],
687 "_source": [
688 "coreKeyWord",
689 "article_index",
690 "seo_category_url",
691 "seo_category_type"
692 ]
693 }
694
695
696 GET seojoindata/_search
697 {
698 "track_total_hits": true,
699 "size": 0,
700 "query": {
701 "bool": {
702 "must": [
703 {
704 "exists": {
705 "field": "article_en"
706 }
707 },
708 {
709 "term": {
710 "weekday.keyword": {
711 "value": "Monday"
712 }
713 }
714 }
715 ]
716 }
717 },
718 "aggs": {
719 "min_max_kId": {
720 "stats": {
721 "field": "article_index"
722 }
723 }
724 }
725 }
726
727
728 GET seojoindata/_search
729 {
730 "track_total_hits": true,
731 "size": 20,
732 "query": {
733 "bool": {
734 "must": [
735 {
736 "exists": {
737 "field": "article_en"
738 }
739 },
740 {
741 "term": {
742 "weekday.keyword": {
743 "value": "Monday"
744 }
745 }
746 }
747 ]
748 }
749 },
750 "search_after": [
751 2034
752 ],
753 "sort": [
754 {
755 "article_index": {
756 "order": "asc"
757 }
758 }
759 ],
760 "_source": [
761 "article_url",
762 "title_en",
763 "weekday",
764 "article_index",
765 "pubdate"
766 ]
767 }
768
769
770
771 GET seojoindata/_search
772 {
773 "track_total_hits": true,
774 "size": 10,
775 "query": {
776 "bool": {
777 "must": [
778 {
779 "term": {
780 "seo_category_Id.keyword": {
781 "value": "seoc14"
782 }
783 }
784 }
785 ]
786 }
787 },
788 "sort": [
789 {
790 "article_index": {
791 "order": "asc"
792 }
793 }
794 ],
795 "_source": ["coreKeyWord","article_index"]
796 }
797
798
799 GET seojoindata/_search
800 {
801 "size": 10,
802 "query": {
803 "bool": {
804 "must": [
805 {
806 "term": {
807 "seo_part_Id.keyword": {
808 "value": "seoc1420"
809 }
810 }
811 }
812 ]
813 }
814 },
815 "sort": [
816 {
817 "pubdate": {
818 "order": "desc"
819 }
820 }
821 ],
822 "_source": ["coreKeyWord"]
823 }
824
825
826 GET seojoindata/_search
827 {
828 "query": {
829 "bool": {
830 "must": [
831 {
832 "term": {
833 "seo_part_Id.keyword": {
834 "value": "seoc1420"
835 }
836 }
837 }
838 ]
839 }
840 },
841 "_source": ["otherkwdlist","pubdate","weekday"]
842 }
843
844
845
846
847
848 GET seojoindata/_search
849 {
850 "query": {
851 "term": {
852 "articleId": {
853 "value": "5e54adcad515cd71ed254315"
854 }
855 }
856 },
857 "_source": {
858 "excludes": [
859 "otherkwdlist",
860 "fullurl",
861 "model",
862 "title",
863 "endSource"
864 ]
865 }
866 }
867
868
869 GET seojoindata/_search
870 {
871 "track_total_hits": true,
872 "from": 0,
873 "size": 20,
874 "query": {
875 "bool": {
876 "must": [
877 {
878 "nested": {
879 "path": "otherkwdlist",
880 "query": {
881 "bool": {
882 "must": [
883 {
884 "term": {
885 "otherkwdlist.keyId": {
886 "value": 5060
887 }
888 }
889 }
890 ]
891 }
892 }
893 }
894 },
895
896 {
897 "exists": {
898 "field": "title_en"
899 }
900 },
901 {
902 "exists": {
903 "field": "article_en"
904 }
905 }
906 ]
907 }
908 },
909 "_source": {
910 "includes": [
911 "title_en",
912 "article_url",
913 "pubdate",
914 "articleId"
915 ]
916 }
917 }
918
919
920 GET seojoindata/_search
921 {
922 "size": 0,
923 "aggs": {
924 "group_by_category": {
925 "terms": {
926 "field": "seo_category_type.keyword",
927 "size": 50
928 },
929 "aggs": {
930 "group_by_part": {
931 "terms": {
932 "field": "seo_part_name.keyword",
933 "size": 100
934 },
935 "aggs": {
936 "group_by_part_url": {
937 "terms": {
938 "field": "seo_part_url",
939 "size": 50
940 }
941 },
942 "group_by_part_id": {
943 "terms": {
944 "field": "seo_part_Id.keyword",
945 "size": 50
946 }
947 }
948 }
949 },
950 "group_by_category_url": {
951 "terms": {
952 "field": "seo_category_url",
953 "size": 50
954 }
955 },
956 "group_by_category_id": {
957 "terms": {
958 "field": "seo_category_Id.keyword",
959 "size": 50
960 }
961 }
962 }
963 }
964 }
965 }
966
967
968
969 GET seojoindata/_search
970 {
971 "size": 5,
972 "query": {
973 "bool": {
974 "must": [
975 {
976 "exists": {
977 "field": "title_en"
978 }
979 },
980 {
981 "term": {
982 "seo_part_Id.keyword": {
983 "value": "seoc1420"
984 }
985 }
986 }
987 ]
988 }
989 },
990 "sort": [
991 {
992 "pubdate": {
993 "order": "desc"
994 }
995 }
996 ],
997 "_source": [
998 "otherkwdlist"
999 ]
1000 }
1001
1002 GET seojoindata/_search
1003 {
1004 "track_total_hits": true,
1005 "from": 0,
1006 "size": 20,
1007 "query": {
1008 "bool": {
1009 "must": [
1010 {
1011 "exists": {
1012 "field": "taglist"
1013 }
1014 },
1015 {
1016 "exists": {
1017 "field": "title_en"
1018 }
1019 },
1020 {
1021 "term": {
1022 "is_valid": {
1023 "value": "1"
1024 }
1025 }
1026 },
1027 {
1028 "term": {
1029 "pubdate": {
1030 "value": "2020-05-06"
1031 }
1032 }
1033 }
1034 ]
1035 }
1036 },
1037 "_source": {
1038 "includes": ["article_url","title_en","pubdate"]
1039 }
1040 }
1041
1042
1043
1044 GET seojoindata/_search
1045 {
1046 "track_total_hits": true,
1047 "size": 0,
1048 "query": {
1049 "bool": {
1050 "must": [
1051 {
1052 "exists": {
1053 "field": "taglist"
1054 }
1055 },
1056 {
1057 "exists": {
1058 "field": "weekday"
1059 }
1060 },
1061 {
1062 "term": {
1063 "is_valid": {
1064 "value": "1"
1065 }
1066 }
1067 }
1068 ]
1069 }
1070 },
1071 "aggs": {
1072 "group_by_week": {
1073 "terms": {
1074 "field": "weekday.keyword",
1075 "size": 12
1076 },
1077 "aggs": {
1078 "sort_by_click": {
1079 "top_hits": {
1080 "sort": [
1081 {
1082 "pubdate": {
1083 "order": "desc"
1084 }
1085 },
1086 {
1087 "clickCount": {
1088 "order": "desc"
1089 }
1090 }
1091 ],
1092 "size": 12,
1093 "_source": {
1094 "includes": [
1095 "article_url",
1096 "title_en",
1097 "pubdate"
1098 ]
1099 }
1100 }
1101 }
1102 }
1103 }
1104 }
1105 }
1106
1107 # 按照星期 1-7 每个都获取对应的数据
1108 GET seojoindata/_search
1109 {
1110 "track_total_hits": true,
1111 "size": 0,
1112 "query": {
1113 "bool": {
1114 "must": [
1115 {
1116 "exists": {
1117 "field": "taglist"
1118 }
1119 },
1120 {
1121 "exists": {
1122 "field": "weekday"
1123 }
1124 },
1125 {
1126 "term": {
1127 "is_valid": {
1128 "value": "1"
1129 }
1130 }
1131 }
1132
1133 ]
1134 }
1135 },
1136 "aggs": {
1137 "group_by_week": {
1138 "terms": {
1139 "field": "weekday.keyword",
1140 "size": 13
1141 },
1142 "aggs": {
1143 "sort_by_click": {
1144 "top_hits": {
1145 "sort": [
1146 {
1147 "pubdate": {
1148 "order": "desc"
1149 }
1150 },
1151 {
1152 "clickCount": {
1153 "order": "desc"
1154 }
1155 }],
1156 "size": 13,
1157 "_source":{
1158 "includes": ["article_url","title_en","pubdate","weekday"]
1159 }
1160 }
1161 }
1162 }
1163 }
1164 }
1165 }
1166
1167
1168
1169 # 当前月份的数据聚合
1170 GET seojoindata/_search
1171 {
1172 "track_total_hits": true,
1173 "size": 0,
1174 "query": {
1175 "bool": {
1176 "must": [
1177 {
1178 "exists": {
1179 "field": "title_en"
1180 }
1181 },
1182 {
1183 "exists": {
1184 "field": "taglist"
1185 }
1186 },
1187 {
1188 "term": {
1189 "is_valid": {
1190 "value": "1"
1191 }
1192 }
1193 },
1194 {
1195 "range": {
1196 "date_pubdate": {
1197 "gte": "2020-07-01",
1198 "lte": "2020-07-31",
1199 "format": "yyyy-MM-dd"
1200 }
1201 }
1202 }
1203 ]
1204 }
1205 },
1206 "aggs": {
1207 "group_by_now_day": {
1208 "date_histogram": {
1209 "field": "date_pubdate",
1210 "calendar_interval": "day",
1211 "format": "yyyy-MM-dd",
1212 "min_doc_count": 0,
1213 "extended_bounds": {
1214 "min": "2020-07-01",
1215 "max": "2020-07-31"
1216 }
1217 }
1218 }
1219 }
1220 }
1221
1222
1223 # 按照年月日三层聚合
1224 GET seojoindata/_search
1225 {
1226 "size": 0,
1227 "query": {
1228 "bool": {
1229 "must": [
1230 {
1231 "term": {
1232 "is_valid": {
1233 "value": "1"
1234 }
1235 }
1236 },
1237 {
1238 "exists": {
1239 "field": "article_en"
1240 }
1241 },
1242 {
1243 "bool": {
1244 "filter": {
1245 "range": {
1246 "date_pubdate": {
1247 "gte": 2020,
1248 "lt": 2021,
1249 "format": "yyyy"
1250 }
1251 }
1252 }
1253 }
1254 }
1255 ]
1256 }
1257 },
1258 "aggs": {
1259 "group_by_year": {
1260 "date_histogram": {
1261 "field": "date_pubdate",
1262 "calendar_interval": "year",
1263 "format": "yyyy",
1264 "min_doc_count": 0,
1265 "order": {
1266 "_key": "desc"
1267 }
1268 },
1269 "aggs": {
1270 "group_by_month": {
1271 "date_histogram": {
1272 "field": "date_pubdate",
1273 "calendar_interval": "month",
1274 "format": "yyyy-MM",
1275 "min_doc_count": 0,
1276 "order": {
1277 "_key": "desc"
1278 }
1279 },
1280 "aggs": {
1281 "group_by_day": {
1282 "date_histogram": {
1283 "field": "date_pubdate",
1284 "calendar_interval": "day",
1285 "format": "yyyy-MM-dd",
1286 "min_doc_count": 0,
1287 "order": {
1288 "_key": "desc"
1289 }
1290 }
1291 }
1292 }
1293 }
1294 }
1295 }
1296 }
1297 }
1298
1299 GET seojoindata/_search
1300 {
1301 "track_total_hits": true,
1302 "query": {
1303 "bool": {
1304 "must": [
1305 {
1306 "exists": {
1307 "field": "article_summery"
1308 }
1309 },
1310 {
1311 "exists": {
1312 "field": "taglist"
1313 }
1314 },
1315 {
1316 "term": {
1317 "is_valid": {
1318 "value": "1"
1319 }
1320 }
1321 }
1322 ]
1323 }
1324 },
1325 "sort": [
1326 {
1327 "pubdate": {
1328 "order": "desc"
1329 }
1330 }
1331 ],
1332 "_source": ["pubdate","date_pubdate"]
1333 }
1334
1335
1336 GET seojoindata_0610/_mapping
1337
1338 GET seojoindata/_search
1339 {
1340 "size": 0,
1341 "query": {
1342 "bool": {
1343 "filter": {
1344 "term": {
1345 "is_valid": 1
1346 }
1347 }
1348 }
1349 },
1350 "aggs": {
1351 "group_by_category_type": {
1352 "terms": {
1353 "field": "seo_category_type.keyword",
1354 "size": 100
1355 },
1356 "aggs": {
1357 "show_category_url": {
1358 "terms": {
1359 "field": "seo_category_url",
1360 "size": 100
1361 }
1362 },
1363 "show_category_Id": {
1364 "terms": {
1365 "field": "seo_category_Id.keyword",
1366 "size": 100
1367 },
1368 "aggs": {
1369 "group_by_part_name": {
1370 "terms": {
1371 "field": "seo_part_name.keyword",
1372 "size": 100
1373 },
1374 "aggs": {
1375 "show_part_url": {
1376 "terms": {
1377 "field": "seo_part_url",
1378 "size": 100
1379 }
1380 },
1381 "show_part_Id": {
1382 "terms": {
1383 "field": "seo_part_Id.keyword",
1384 "size": 100
1385 }
1386 }
1387 }
1388 }
1389 }
1390 }
1391 }
1392 }
1393 }
1394 }
1395
1396
1397 GET seojoindata/_search
1398 {
1399 "track_total_hits": true,
1400 "query": {
1401 "regexp": {"article_en": "[\u4e00-\u9fa5]"}
1402 },
1403 "_source": ["article_en","articleId","endSource","fullurl"]
1404 }
1405
1406 GET seojoindata/_search
1407 {
1408 "query": {
1409 "match_all": {}
1410 }
1411 }
1412
1413 GET seojoindata/_search
1414 {
1415 "size": 20,
1416 "query": {
1417 "bool": {
1418 "must": [
1419 {
1420 "exists": {
1421 "field": "taglist.tagId"
1422 }
1423 },
1424 {
1425 "nested": {
1426 "path": "coreKeyWord",
1427 "query": {
1428 "exists": {
1429 "field": "coreKeyWord.corekwdId"
1430 }
1431 }
1432 }
1433 },
1434 {
1435 "term": {
1436 "is_valid": {
1437 "value": 1
1438 }
1439 }
1440 },
1441 {
1442 "exists": {
1443 "field": "article_en"
1444 }
1445 },
1446 {
1447 "exists": {
1448 "field": "title_en"
1449 }
1450 },
1451 {
1452 "exists": {
1453 "field": "seo_part_Id"
1454 }
1455 }
1456 ]
1457 }
1458 },
1459 "aggs": {
1460 "group_by_part": {
1461 "terms": {
1462 "field": "seo_part_name.keyword",
1463 "size": 50
1464 },
1465 "aggs": {
1466 "group_by_part_url": {
1467 "terms": {
1468 "field": "seo_part_url",
1469 "size": 1
1470 }
1471 },
1472 "group_by_part_Id": {
1473 "terms": {
1474 "field": "seo_part_Id.keyword",
1475 "size": 1
1476 }
1477 }
1478 }
1479 }
1480 }
1481 }
1482
1483
1484 GET seojoindata/_search
1485 {
1486 "size": 2000,
1487 "query": {
1488 "bool": {
1489 "should": [
1490 {
1491 "term": {
1492 "FIELD": {
1493 "value": "VALUE"
1494 }
1495 }
1496 },{
1497 "term": {
1498 "FIELD": {
1499 "value": "VALUE"
1500 }
1501 }
1502 }
1503 ]
1504 }
1505 },
1506 "_source": {
1507 "includes": ["article_summery","article_en"]
1508 }
1509 }
1510
1511
1512 GET seojoindata/_search
1513 {
1514 "track_total_hits": true,
1515 "query": {
1516 "bool": {
1517 "must": [
1518
1519 ]
1520 }
1521 },
1522 "_source": ["article_index","article_en"]
1523 }
1524
1525 GET seojoindata/_search
1526 {
1527 "track_total_hits": true,
1528 "size": 10,
1529 "query": {
1530 "bool": {
1531 "must": [
1532 {
1533 "term": {
1534 "seo_part_Id.keyword": {
1535 "value": "seoc2126"
1536 }
1537 }
1538 }
1539 ]
1540 }
1541 },
1542 "search_after":[2034],
1543 "sort": [
1544 {
1545 "article_index": {
1546 "order": "asc"
1547 }
1548 }
1549 ],
1550 "_source": ["article_index","otherkwdlist"]
1551 }
1552
1553
1554 # otherkwdlist.keyId 的最大最小编号
1555 GET seojoindata/_search
1556 {
1557 "track_total_hits": true,
1558 "size": 0,
1559 "query": {
1560 "constant_score": {
1561 "filter": {
1562 "term": {
1563 "seo_part_Id.keyword": "seoc2126"
1564 }
1565 },
1566 "boost": 1.2
1567 }
1568 },
1569 "aggs": {
1570 "group_by_otherkwd": {
1571 "nested": {
1572 "path": "otherkwdlist"
1573 },
1574 "aggs": {
1575 "min_max_kwdid": {
1576 "stats": {
1577 "field": "otherkwdlist.keyId"
1578 }
1579 }
1580 }
1581 },
1582 "group_by_article_index": {
1583 "stats": {
1584 "field": "article_index"
1585 }
1586 }
1587 }
1588 }
1589
1590
1591 # 对应文章编号
1592 GET seojoindata/_search
1593 {
1594 "size": 0,
1595 "query": {
1596 "constant_score": {
1597 "filter": {
1598 "term": {
1599 "seo_part_Id.keyword": "seoc2126"
1600 }
1601 },
1602 "boost": 1.2
1603 }
1604 },
1605 "aggs": {
1606 "group_by_otherkwd": {
1607 "stats": {
1608 "field": "article_index"
1609 }
1610 }
1611 }
1612 }
1613
1614 GET seojoindata/_search
1615 {
1616 "size": 0,
1617 "aggs": {
1618 "group_by_category": {
1619 "terms": {
1620 "field": "seo_category_type.keyword",
1621 "size": 50
1622 },
1623 "aggs": {
1624 "group_by_part": {
1625 "terms": {
1626 "field": "seo_part_name.keyword",
1627 "size": 100
1628 },
1629 "aggs": {
1630 "group_by_part_url": {
1631 "terms": {
1632 "field": "seo_part_url",
1633 "size": 50
1634 }
1635 },
1636 "group_by_part_id": {
1637 "terms": {
1638 "field": "seo_part_Id.keyword",
1639 "size": 50
1640 }
1641 }
1642 }
1643 },
1644 "group_by_category_url": {
1645 "terms": {
1646 "field": "seo_category_url",
1647 "size": 50
1648 }
1649 },
1650 "group_by_category_id": {
1651 "terms": {
1652 "field": "seo_category_Id.keyword",
1653 "size": 50
1654 }
1655 }
1656 }
1657 }
1658 }
1659 }
1660
1661
1662
1663
1664
1665 GET seojoindata/_search
1666 {
1667 "size":10,
1668 "query": {
1669 "bool": {
1670 "must": [
1671 {
1672 "exists": {
1673 "field": "title_en"
1674 }
1675 },
1676 {
1677 "term": {
1678 "seo_part_Id.keyword": {
1679 "value": "seoc2126"
1680 }
1681 }
1682 }
1683 ]
1684 }
1685 },
1686 "sort": [
1687 {
1688 "pubdate": {
1689 "order": "desc"
1690 }
1691 }
1692 ],
1693 "_source": ["otherkwdlist","seo_part_Id"]
1694 }
1695
1696 GET seojoindata_0610/_search
1697 {
1698 "size": 0,
1699 "aggs": {
1700 "group_by_category": {
1701 "terms": {
1702 "field": "seo_category_type.keyword",
1703 "size": 10
1704 },
1705 "aggs": {
1706 "group_by_part": {
1707 "terms": {
1708 "field": "seo_part_name.keyword",
1709 "size": 100
1710 },
1711 "aggs": {
1712 "group_by_other": {
1713 "nested": {
1714 "path": "otherkwdlist"
1715 },
1716 "aggs": {
1717 "group_by_other_kwd": {
1718 "terms": {
1719 "field": "otherkwdlist.keyname.raw",
1720 "size": 50
1721 },
1722 "aggs": {
1723 "distinct": {
1724 "cardinality": {
1725 "field": "otherkwdlist.keyname.raw"
1726 }
1727 }
1728 }
1729 }
1730 }
1731 }
1732 }
1733 }
1734 }
1735 }
1736 }
1737 }
1738
1739
1740 GET seokeytagsdata/_search
1741 {
1742 "query": {
1743 "terms": {
1744 "corekwd.raw": [
1745 "amuc_1100",
1746 "a _",
1747 "amuc_1100 akkermansia"
1748 ]
1749 }
1750 }
1751 }
1752
1753 GET seokeytagsdata/_search
1754 {
1755 "query": {
1756 "term": {
1757 "corekwd.raw": {
1758 "value": "before ach can be inactivated _______ must be present"
1759 }
1760 }
1761 }
1762 }
1763
1764
1765 GET seojoindata/_search
1766 {
1767 "track_total_hits": true,
1768 "size": 200,
1769 "query": {
1770 "bool": {
1771 "must": [
1772 {
1773 "exists": {
1774 "field": "article_en"
1775 }
1776 },
1777 {
1778 "term": {
1779 "weekday.keyword": {
1780 "value": "Tuesday"
1781 }
1782 }
1783 }
1784 ]
1785 }
1786 },
1787 "search_after": [0],
1788 "sort": [
1789 {
1790 "article_index": {
1791 "order": "asc"
1792 }
1793 }
1794 ],
1795 "_source": ["article_url","title_en","weekday","article_index"]
1796 }
1797
1798
1799 GET seojoindata/_search
1800 {
1801 "track_total_hits": true,
1802 "size": 0,
1803 "query": {
1804 "bool": {
1805 "must": [
1806 {
1807 "exists": {
1808 "field": "article_en"
1809 }
1810 },
1811 {
1812 "term": {
1813 "weekday.keyword": {
1814 "value": "Monday"
1815 }
1816 }
1817 }
1818 ]
1819 }
1820 },
1821 "aggs": {
1822 "min_max_kId": {
1823 "stats": {
1824 "field": "article_index"
1825 }
1826 }
1827 }
1828 }
1829
1830
1831 GET seojoindata/_search
1832 {
1833 "query": {
1834 "bool": {
1835 "must": [
1836 {
1837 "exists": {
1838 "field": "is_valid"
1839 }
1840 }
1841 ]
1842 }
1843 },
1844 "sort": [
1845 {
1846 "article_index": {
1847 "order": "asc"
1848 }
1849 }
1850 ],
1851 "_source": ["seo_category_url","seo_part_url","is_valid","article_index"]
1852 }
1853
1854 # Site Index1 按照分类 产品大类 小类
1855 GET seojoindata/_search
1856 {
1857 "size": 0,
1858 "aggs": {
1859 "group_by_category": {
1860 "terms": {
1861 "field": "seo_category_type.keyword",
1862 "size": 50
1863 },
1864 "aggs": {
1865 "group_by_part": {
1866 "terms": {
1867 "field": "seo_part_name.keyword",
1868 "size": 100
1869 },
1870 "aggs": {
1871 "group_by_part_url": {
1872 "terms": {
1873 "field": "seo_part_url",
1874 "size": 50
1875 }
1876 },
1877 "group_by_part_id": {
1878 "terms": {
1879 "field": "seo_part_Id.keyword",
1880 "size": 50
1881 }
1882 }
1883 }
1884 },
1885 "group_by_category_url": {
1886 "terms": {
1887 "field": "seo_category_url",
1888 "size": 50
1889 }
1890 },
1891 "group_by_category_id": {
1892 "terms": {
1893 "field": "seo_category_Id.keyword",
1894 "size": 50
1895 }
1896 }
1897 }
1898 }
1899 }
1900 }
1901
1902
1903 GET seojoindata/_search
1904 {
1905 "query": {
1906 "match_all": {}
1907 },
1908 "_source": ["otherkwdlist","seo"]
1909 }
1910
1911
1912 # Site Index 2 一级分类下的二级对应的关键词 top 50
1913 GET seojoindata_0610/_search
1914 {
1915 "size": 0,
1916 "aggs": {
1917 "group_by_category": {
1918 "terms": {
1919 "field": "seo_category_type.keyword",
1920 "size": 10
1921 },
1922 "aggs": {
1923 "group_by_part": {
1924 "terms": {
1925 "field": "seo_part_name.keyword",
1926 "size": 100
1927 },
1928 "aggs": {
1929 "group_by_other": {
1930 "nested": {
1931 "path": "otherkwdlist"
1932 },
1933 "aggs": {
1934 "group_by_other_kwd": {
1935 "terms": {
1936 "field": "otherkwdlist.keyname_after.raw",
1937 "size": 50
1938 },
1939 "aggs": {
1940 "distinct": {
1941 "cardinality": {
1942 "field": ""
1943 }
1944 }
1945 }
1946 }
1947 }
1948 }
1949 }
1950 }
1951 }
1952 }
1953 }
1954 }
1955
1956 # 3 按照关键词的搜索量排序
1957 GET seokeytagsdata/_search
1958 {
1959 "size": 0,
1960 "query": {
1961 "bool": {
1962 "must": [
1963 {
1964 "range": {
1965 "match_count": {
1966 "gte": 1
1967 }
1968 }
1969 }
1970 ]
1971 }
1972 },
1973 "aggs": {
1974 "group_by_click": {
1975 "terms": {
1976 "field": "clickCount",
1977 "size": 100
1978 },
1979 "aggs": {
1980 "show_key": {
1981 "terms": {
1982 "field": "corekwd.raw",
1983 "size": 100
1984 }
1985 }
1986 }
1987 }
1988 }
1989 }
1990
1991 # 4 按照关键词匹配的文章数排序
1992 GET seokeytagsdata/_search
1993 {
1994 "size": 0,
1995 "query": {
1996 "bool": {
1997 "must": [
1998 {
1999 "range": {
2000 "match_count": {
2001 "gte": 1
2002 }
2003 }
2004 }
2005 ]
2006 }
2007 },
2008 "aggs": {
2009 "group_by_match": {
2010 "terms": {
2011 "field": "match_count",
2012 "size": 100
2013 },
2014 "aggs": {
2015 "show_keys": {
2016 "terms": {
2017 "field": "corekwdId",
2018 "size": 30
2019 }
2020 }
2021 }
2022 }
2023 }
2024 }
2025
2026 # 4 按照星期
2027 GET seojoindata/_search
2028 {
2029 "size": 2000,
2030 "query": {
2031 "bool": {
2032 "must": [
2033 {
2034 "exists": {
2035 "field": "weekday"
2036 }
2037 }
2038 ]
2039 }
2040 },
2041 "_source": ["weekday","seo_category_Id","seo_part_name","article_summery","articleId"]
2042 }
2043
2044 GET seojoindata/_count
2045
2046 GET seojoindata/_search
2047 {
2048 "size": 2000,
2049 "query": {
2050 "bool": {
2051 "must": [
2052 {
2053 "exists": {
2054 "field": "article_index"
2055 }
2056 }
2057 ]
2058 }
2059 },
2060 "sort": [
2061 {
2062 "article_index": {
2063 "order": "asc"
2064 }
2065 }
2066 ],
2067 "_source": ["weekday","articleId","article_index"]
2068 }
2069
2070
2071 GET seojoindata/_search
2072 {
2073 "track_total_hits": true,
2074 "size": 200,
2075 "query": {
2076 "bool": {
2077 "must": [
2078 {
2079 "exists": {
2080 "field": "weekday"
2081 }
2082 },
2083 {
2084 "exists": {
2085 "field": "article_en"
2086 }
2087 },
2088 {
2089 "exists": {
2090 "field": "title_en"
2091 }
2092 },
2093 {
2094 "term": {
2095 "weekday.keyword": {
2096 "value": "Tuesday"
2097 }
2098 }
2099 }
2100 ]
2101 }
2102 },
2103 "_source": ["weekday","seo_category_Id","seo_part_name","title_en","article_url","pubdate"],
2104 "sort": [
2105 {
2106 "pubdate": {
2107 "order": "desc"
2108 }
2109 }
2110 ]
2111
2112 }
2113
2114
2115
2116 GET seojoindata/_search
2117 {
2118 "track_total_hits": true,
2119 "query": {
2120 "term": {
2121 "weekday.keyword": {
2122 "value": "Monday"
2123 }
2124 }
2125 }
2126 }
2127
2128
2129
2130
2131 GET seojoindata/_mapping
2132
2133
2134 GET seojoindata/_count
2135
2136 # POST seojoindata/_delete_by_query
2137
2138 GET seojoindata/_search
2139 {
2140 "track_total_hits": true,
2141 "query": {
2142 "bool": {
2143 "must": [
2144 {
2145 "exists": {
2146 "field": "title_en"
2147 }
2148 },
2149 {
2150 "exists": {
2151 "field": "article_en"
2152 }
2153 }
2154 ]
2155 }
2156 }
2157 }
2158
2159
2160 GET seokeytagsdata/_search
2161 {
2162 "query": {
2163 "term": {
2164 "corekwdId": {
2165 "value": "130645"
2166 }
2167 }
2168 }
2169 }
2170
2171
2172
2173 GET seokeytagsdata/_search
2174 {
2175 "query": {
2176 "terms": {
2177 "corekwdId": [
2178 "130645"
2179 ]
2180 }
2181 },
2182 "_source": ["corekwd","after_keytag","tag_key_url"]
2183 }
2184
2185
2186
2187
2188 GET seokeytagsdata/_search
2189 {
2190 "query": {
2191 "regexp": {
2192 "corekwd.raw": "_+"
2193 }
2194
2195 }
2196 }
2197
2198
2199 GET seojoindata/_doc/wnRnFnIBcd8f2VExRGIx
2200
2201 GET seojoindata/_count
2202
2203 GET seojoindata/_search
2204 {
2205 "query": {
2206 "term": {
2207 "endSource": {
2208 "value": "mp.souhu.com "
2209 }
2210 }
2211 }
2212 }
2213
2214 GET seojoindata/_search
2215 {
2216 "query": {
2217 "term": {
2218 "articleId": {
2219 "value": "5e5638c2e42464a085d7755a"
2220 }
2221 }
2222 }
2223 }
2224
2225
2226 GET seokeytagsdata/_search
2227 {
2228 "size": 1000,
2229 "query": {
2230 "term": {
2231 "keywords_type": {
2232 "value": 1
2233 }
2234 }
2235 },
2236 "_source": ["corekwdId","match_count"]
2237 }
2238
2239
2240
2241 GET seojoindata_backup/_search
2242 {
2243 "query": {
2244 "term": {
2245 "articleId": {
2246 "value": "5eba799e8fdca9edee88f27c"
2247 }
2248 }
2249 },
2250 "_source": ["article_summery","article_en"]
2251 }
2252
2253
2254 GET seojoindata/_search
2255 {
2256 "size": 2000,
2257 "query": {
2258 "regexp": {
2259 "pubdate": "2020-05-*.*"
2260 }
2261 },
2262 "_source": ["article_summery","articleId"]
2263 }
2264
2265
2266
2267
2268
2269 GET seojoindata/_search
2270 {
2271 "size": 0,
2272 "query": {
2273 "bool": {
2274 "must": [
2275 {
2276 "exists": {
2277 "field": "taglist.tagId"
2278 }
2279 },
2280 {
2281 "exists": {
2282 "field": "article_en"
2283 }
2284 },
2285 {
2286 "nested": {
2287 "path": "coreKeyWord",
2288 "query": {
2289 "exists": {
2290 "field": "coreKeyWord.corekwdId"
2291 }
2292 }
2293 }
2294 },
2295 {
2296 "term": {
2297 "is_valid": {
2298 "value": 1
2299 }
2300 }
2301 },
2302 {
2303 "term": {
2304 "seo_category_Id.keyword": {
2305 "value": "seoc14"
2306 }
2307 }
2308 },
2309 {
2310 "exists": {
2311 "field": "article_summery"
2312 }
2313 }
2314 ]
2315 }
2316 },
2317 "aggs": {
2318 "group_by_part_Id": {
2319 "terms": {
2320 "field": "seo_part_Id.keyword",
2321 "size": 50
2322 },
2323 "aggs": {
2324 "top_articles": {
2325 "top_hits": {
2326 "sort": [
2327 {
2328 "pubdate": {
2329 "order": "desc"
2330 }
2331 }
2332 ],
2333 "size": 10,
2334 "_source": {
2335 "includes": [
2336 "title_en",
2337 "article_url",
2338 "articleId",
2339 "part_Id",
2340 "part_name",
2341 "category_type",
2342 "category_Id",
2343 "seo_part_url",
2344 "seo_part_Id",
2345 "seo_part_name",
2346 "seo_category_url",
2347 "seo_category_type",
2348 "seo_category_Id",
2349 "article_summery",
2350 "pubdate"
2351 ]
2352 }
2353 }
2354 }
2355 }
2356 }
2357 },
2358 "_source": {
2359 "excludes": [
2360 "article_en",
2361 "otherkwdlist",
2362 "taglist",
2363 "title",
2364 "article_keys",
2365 "fullurl",
2366 "endSource",
2367 "originalKeyWord",
2368 "coreKwdCount",
2369 "model",
2370 "clickCount"
2371 ]
2372 }
2373 }
2374
2375
2376 GET seojoindata/_search
2377 {
2378 "size": 10,
2379 "query": {
2380 "bool": {
2381 "must": [
2382 {
2383 "exists": {
2384 "field": "taglist.tagId"
2385 }
2386 },
2387 {
2388 "exists": {
2389 "field": "title_en"
2390 }
2391 },
2392 {
2393 "nested": {
2394 "path": "coreKeyWord",
2395 "query": {
2396 "exists": {
2397 "field": "coreKeyWord.corekwdId"
2398 }
2399 }
2400 }
2401 },
2402 {
2403 "term": {
2404 "is_valid": {
2405 "value": 1
2406 }
2407 }
2408 },
2409 {
2410 "term": {
2411 "seo_category_Id.keyword": {
2412 "value": "seoc14"
2413 }
2414 }
2415 },
2416 {
2417 "exists": {
2418 "field": "article_en"
2419 }
2420 },
2421 {
2422 "exists": {
2423 "field": "article_summery"
2424 }
2425 }
2426 ]
2427 }
2428 },
2429 "_source": {
2430 "excludes": [
2431 "article_en",
2432 "otherkwdlist",
2433 "taglist",
2434 "title",
2435 "article_keys",
2436 "fullurl",
2437 "endSource",
2438 "coreKeyWord",
2439 "originalKeyWord",
2440 "model",
2441 "part_Id",
2442 "part_name"
2443 ]
2444 },
2445 "sort": [
2446 {
2447 "pubdate": {
2448 "order": "desc"
2449 }
2450 }
2451 ]
2452 }
2453
2454
2455 GET seojoindata/_search
2456 {
2457 "track_total_hits": true,
2458 "size": 4000,
2459 "query": {
2460 "bool": {
2461 "must": [
2462 {
2463 "exists": {
2464 "field": "taglist.tagId"
2465 }
2466 },
2467 {
2468 "exists": {
2469 "field": "article_en"
2470 }
2471 },
2472 {
2473 "nested": {
2474 "path": "coreKeyWord",
2475 "query": {
2476 "bool": {
2477 "must": [
2478 {
2479 "exists": {
2480 "field": "coreKeyWord.corekwdId"
2481 }
2482 }
2483 ]
2484 }
2485 }
2486 }
2487 }
2488 ]
2489 }
2490 },
2491 "_source": {
2492 "includes": [
2493 "title_en",
2494 "articleId",
2495 "article_url"
2496 ]
2497 },
2498 "sort": [
2499 {
2500 "pubdate": {
2501 "order": "desc"
2502 }
2503 }
2504 ]
2505 }
2506
2507
2508 GET seojoindata/_count
2509
2510 GET _analyze
2511 {
2512 "text": "I am so excited to going to the x-school",
2513 "analyzer": "standard"
2514 }
2515
2516 GET seokeytagsdata/_search
2517 {
2518 "size":2000,
2519 "query": {
2520 "match_all": {}
2521 },
2522 "_source": ["corekwdId","match_count"]
2523 }
2524
2525
2526 GET seokeytagsdata/_search
2527 {
2528 "track_total_hits": true,
2529 "size": 0,
2530 "query": {
2531 "bool": {
2532 "must": [
2533 {
2534 "range": {
2535 "match_count": {
2536 "gte": 5
2537 }
2538 }
2539 },
2540 {
2541 "regexp": {
2542 "corekwd.raw": "a.*"
2543 }
2544 }
2545 ]
2546 }
2547 },
2548 "aggs": {
2549 "min_max_kId": {
2550 "stats": {
2551 "field": "corekwdId"
2552 }
2553 }
2554 }
2555 }
2556 GET seojoindata/_search
2557 {
2558 "query": {
2559 "term": {
2560 "articleId": {
2561 "value": "5ebad8338fdca9edee896934"
2562 }
2563 }
2564 }
2565 }
2566
2567
2568 GET seokeytagsdata_back/_coun
2569
2570 # DELETE seojoindata_back
2571
2572
2573
2574 GET seokeytagsdata_back/_mapping
2575
2576 GET seokeytagsdata/_count
2577
2578 GET seokeytagsdata/_search
2579 {
2580 "size":1000,
2581 "query": {
2582 "terms": {
2583 "corekwdId": [
2584 563996
2585
2586 ]
2587 }
2588 },
2589 "_source": {
2590 "includes": ["corekwdId","match_count"]
2591 }
2592 }
2593
2594
2595 GET seojoindata_prefix/_search
2596 {
2597 "query": {
2598 "exists": {
2599 "field": "article_summery"
2600 }
2601 },
2602 "_source": ["article_summery","title_en"]
2603 }
2604
2605
2606 GET seojoindata_prefix/_search
2607 {
2608 "query": {
2609 "bool": {
2610 "must": [
2611 {
2612 "exists": {
2613 "field": "article_summery"
2614 }
2615 }
2616 ]
2617 }
2618 }
2619 }
2620
2621
2622 GET seojoindata_prefix/_search
2623 {
2624 "query": {
2625 "bool": {
2626 "must": [
2627 {
2628 "term": {
2629 "articleId": {
2630 "value": "5eba79c48fdca9edee88f2d8"
2631 }
2632 }
2633 }
2634 ],
2635 "should": [
2636 {
2637 "match": {
2638 "article_en": {
2639 "query": "hiring in texas city",
2640 "minimum_should_match": "60%"
2641 }
2642 }
2643 }
2644 ]
2645 }
2646 },
2647 "highlight": {
2648 "no_match_size": 250,
2649 "fragment_size": 250,
2650 "number_of_fragments": 1,
2651 "pre_tags": [
2652 ""
2653 ],
2654 "post_tags": [
2655 ""
2656 ],
2657 "fields": {
2658 "article_en": {
2659 "type": "plain"
2660 }
2661 }
2662 },
2663 "_source": {
2664 "includes": ["articleId"]
2665 }
2666 }
2667
2668 GET seojoindata_prefix/_search
2669 {
2670 "query": {
2671 "nested": {
2672 "path": "coreKeyWord",
2673 "query": {
2674 "bool": {
2675 "must": [
2676 {
2677 "exists": {
2678 "field": "coreKeyWord.corekwd"
2679 }
2680 }
2681 ]
2682 }
2683 }
2684 }
2685 },
2686 "_source": ["coreKeyWord","title_en","originalKeyWord"]
2687 }
2688
2689
2690 GET seojoindata_prefix/_search
2691 {
2692 "size":1000,
2693 "query": {
2694 "match_all": {}
2695 }
2696 }
2697
2698 GET seojoindata_prefix/_search
2699 {
2700 "size": 500,
2701 "query": {
2702 "bool": {
2703 "must": [
2704 {
2705 "exists": {
2706 "field": "article_summery"
2707 }
2708 },
2709 {
2710 "exists": {
2711 "field": "taglist"
2712 }
2713 }
2714 ]
2715 }
2716 },
2717 "_source": ["article_summery","articleId","coreKeyWord"]
2718 }
2719
2720
2721 GET seojoindata/_search
2722 {
2723 "track_total_hits": true,
2724 "query": {
2725 "bool": {
2726 "must": [
2727 {
2728 "exists": {
2729 "field": "taglist"
2730 }
2731 }
2732 ]
2733 }
2734 },
2735 "_source": {
2736 "excludes": ["article_en","article_summery","article_keys"]
2737 }
2738 }
2739
2740
2741 GET seokeytagsdata/_search
2742 {
2743 "track_total_hits": true,
2744 "size": 2000,
2745 "query": {
2746 "bool": {
2747 "must": [
2748 {
2749 "exists": {
2750 "field": "tag_key_url"
2751 }
2752 }
2753 ]
2754 }
2755 },
2756 "_source": {
2757 "includes": ["corekwdId","corekwd","tag_key_url"]
2758 }
2759 }
2760
2761 GET seojoindata/_search
2762 {
2763 "size": 0,
2764 "query": {
2765 "bool": {
2766 "filter": {
2767 "term": {
2768 "is_valid": 1
2769 }
2770 }
2771 }
2772 },
2773 "aggs": {
2774 "group_by_category": {
2775 "terms": {
2776 "field": "seo_category_type.keyword",
2777 "size": 100
2778 },
2779 "aggs": {
2780 "group_by_category_url":{
2781 "terms": {
2782 "field": "seo_category_url",
2783 "size": 1
2784 }
2785 },
2786 "group_by_category_Id": {
2787 "terms": {
2788 "field": "seo_category_Id.keyword",
2789 "size": 1
2790 }
2791 }
2792 }
2793 }
2794 }
2795 }
2796
2797 GET seojoindata_back/_search
2798 {
2799 "size": 0,
2800 "query": {
2801 "bool": {
2802 "must": [
2803 {
2804 "exists": {
2805 "field": "taglist.tagId"
2806 }
2807 },
2808 {
2809 "exists": {
2810 "field": "article_en"
2811 }
2812 },
2813 {
2814 "nested": {
2815 "path": "coreKeyWord",
2816 "query": {
2817 "exists": {
2818 "field": "coreKeyWord.corekwdId"
2819 }
2820 }
2821 }
2822 },
2823 {
2824 "term": {
2825 "seo_category_Id.keyword": {
2826 "value": "seoc14"
2827 }
2828 }
2829 }
2830 ]
2831 }
2832 },
2833 "aggs": {
2834 "group_by_tag_name": {
2835 "terms": {
2836 "field": "taglist.tag.raw",
2837 "size": 10
2838 },
2839 "aggs": {
2840 "group_by_tag_url":{
2841 "terms": {
2842 "field": "taglist.tag_url",
2843 "size": 1
2844 }
2845 },
2846 "group_by_tag_Id": {
2847 "terms": {
2848 "field": "taglist.tagId",
2849 "size": 1
2850 }
2851 }
2852 }
2853 }
2854 }
2855 }
2856
2857
2858 GET seojoindata_back/_search
2859 {
2860 "size": 0,
2861 "query": {
2862 "bool": {
2863 "must": [
2864 {
2865 "exists": {
2866 "field": "taglist.tagId"
2867 }
2868 },
2869 {
2870 "exists": {
2871 "field": "article_en"
2872 }
2873 },
2874 {
2875 "nested": {
2876 "path": "coreKeyWord",
2877 "query": {
2878 "exists": {
2879 "field": "coreKeyWord.corekwdId"
2880 }
2881 }
2882 }
2883 },
2884 {
2885 "term": {
2886 "is_valid": {
2887 "value": 1
2888 }
2889 }
2890 },
2891 {
2892 "term": {
2893 "seo_category_Id.keyword": {
2894 "value": "seoc14"
2895 }
2896 }
2897 },
2898 {
2899 "exists": {
2900 "field": "article_summery"
2901 }
2902 }
2903 ]
2904 }
2905 },
2906 "aggs": {
2907 "group_by_part_Id": {
2908 "terms": {
2909 "field": "seo_part_Id.keyword",
2910 "size": 50
2911 },
2912 "aggs": {
2913 "top_articles": {
2914 "top_hits": {
2915 "sort": [
2916 {
2917 "pubdate": {
2918 "order": "desc"
2919 }
2920 }
2921 ],
2922 "size": 10,
2923 "_source": {
2924 "includes": [
2925 "title_en",
2926 "taglist",
2927 "articleId",
2928 "part_Id",
2929 "part_name",
2930 "article_url",
2931 "category_type",
2932 "category_Id",
2933 "seo_part_url",
2934 "seo_part_Id",
2935 "seo_part_name",
2936 "seo_category_url",
2937 "seo_category_type",
2938 "seo_category_Id",
2939 "article_summery",
2940 "pubdate"
2941 ]
2942 }
2943 }
2944 }
2945 }
2946 }
2947 },
2948 "_source": {
2949 "excludes": [
2950 "article_en",
2951 "otherkwdlist",
2952 "taglist",
2953 "title",
2954 "article_keys",
2955 "fullurl",
2956 "endSource",
2957 "originalKeyWord",
2958 "coreKwdCount",
2959 "model",
2960 "clickCount"
2961 ]
2962 }
2963 }
2964
2965 GET seojoindata_back/_search
2966 {
2967 "size": 0,
2968 "query": {
2969 "bool": {
2970 "filter": {
2971 "term": {
2972 "is_valid": 1
2973 }
2974 }
2975 }
2976 },
2977 "aggs": {
2978 "group_by_category_type": {
2979 "terms": {
2980 "field": "seo_category_type.keyword",
2981 "size": 100
2982 },
2983 "aggs": {
2984 "show_category_url":{
2985 "terms": {
2986 "field": "seo_category_url",
2987 "size": 100
2988 }
2989 },
2990 "show_category_Id": {
2991 "terms": {
2992 "field": "seo_category_Id.keyword",
2993 "size": 100
2994 },
2995 "aggs": {
2996 "group_by_part_name": {
2997 "terms": {
2998 "field": "seo_part_name.keyword",
2999 "size": 100
3000 },
3001 "aggs": {
3002 "show_part_url":{
3003 "terms": {
3004 "field": "seo_part_url",
3005 "size": 100
3006 }
3007 },
3008 "show_part_Id": {
3009 "terms": {
3010 "field": "seo_part_Id.keyword",
3011 "size": 100
3012 }
3013 }
3014 }
3015 }
3016 }
3017 }
3018 }
3019 }
3020 }
3021 }
3022
3023 GET seojoindata_back/_search
3024 {
3025 "track_total_hits": true,
3026 "size": 400,
3027 "query": {
3028 "bool": {
3029 "must": [
3030 {
3031 "exists": {
3032 "field": "article_en"
3033 }
3034 }
3035 ]
3036 }
3037 },
3038 "_source": {
3039 "excludes": ["article_en","article_summery","model","fullurl","clickCount","article_keys","title","part_name","pubdate"]
3040 }
3041 }
3042
3043 GET seojoindata/_search
3044 {
3045 "query": {
3046 "term": {
3047 "articleId": {
3048 "value": "5ebae4798fdca9edee89730c"
3049 }
3050 }
3051 }
3052 }
3053
3054 GET seojoindata/_search
3055 {
3056 "track_total_hits": true,
3057 "size": 200,
3058 "query": {
3059 "bool": {
3060 "must": [
3061 {
3062 "exists": {
3063 "field": "title_en"
3064 }
3065 },
3066 {
3067 "exists": {
3068 "field": "article_url"
3069 }
3070 }
3071 ]
3072 }
3073 }
3074 }
3075
3076 PUT seojoindata_0610
3077 {
3078 "mappings": {
3079 "properties": {
3080 "article_index": {
3081 "type": "long"
3082 },
3083 "articleId": {
3084 "type": "keyword"
3085 },
3086 "article_en": {
3087 "type": "text",
3088 "analyzer": "english"
3089 },
3090 "article_hot_flag": {
3091 "type": "long"
3092 },
3093 "article_keys": {
3094 "type": "text",
3095 "fields": {
3096 "raw": {
3097 "type": "keyword"
3098 }
3099 }
3100 },
3101 "article_summery": {
3102 "type": "text",
3103 "fields": {
3104 "raw": {
3105 "type": "keyword"
3106 }
3107 }
3108 },
3109 "article_url": {
3110 "type": "keyword"
3111 },
3112 "category_Id": {
3113 "type": "text",
3114 "fields": {
3115 "keyword": {
3116 "type": "keyword",
3117 "ignore_above": 256
3118 }
3119 }
3120 },
3121 "category_type": {
3122 "type": "keyword"
3123 },
3124 "clickCount": {
3125 "type": "long"
3126 },
3127 "coreKeyWord": {
3128 "type": "nested",
3129 "properties": {
3130 "corekwd": {
3131 "type": "text",
3132 "analyzer": "english"
3133 },
3134 "corekwdId": {
3135 "type": "long"
3136 },
3137 "corekwd_after": {
3138 "type": "text",
3139 "fields": {
3140 "raw": {
3141 "type": "keyword",
3142 "ignore_above": 512
3143 }
3144 },
3145 "analyzer": "english"
3146 },
3147 "tag_key_url": {
3148 "type": "keyword"
3149 }
3150 }
3151 },
3152 "coreKwdCount": {
3153 "type": "long"
3154 },
3155 "del_flag": {
3156 "type": "long"
3157 },
3158 "doc": {
3159 "properties": {
3160 "article_summery": {
3161 "type": "text",
3162 "fields": {
3163 "keyword": {
3164 "type": "keyword",
3165 "ignore_above": 256
3166 }
3167 }
3168 }
3169 }
3170 },
3171 "endSource": {
3172 "type": "keyword"
3173 },
3174 "fullurl": {
3175 "type": "keyword"
3176 },
3177 "is_valid": {
3178 "type": "long"
3179 },
3180 "model": {
3181 "type": "keyword"
3182 },
3183 "originalKeyWord": {
3184 "type": "text",
3185 "analyzer": "english"
3186 },
3187 "otherkwdlist": {
3188 "type": "nested",
3189 "properties": {
3190 "keyId": {
3191 "type": "long"
3192 },
3193 "keyname": {
3194 "type": "text",
3195 "fields": {
3196 "raw": {
3197 "type": "keyword",
3198 "ignore_above": 512
3199 }
3200 },
3201 "analyzer": "english"
3202 },
3203 "keyname_after": {
3204 "type": "text",
3205 "fields": {
3206 "raw": {
3207 "type": "keyword",
3208 "ignore_above": 256
3209 }
3210 },
3211 "analyzer": "english"
3212 },
3213 "otherkwdurl": {
3214 "type": "text",
3215 "fields": {
3216 "keyword": {
3217 "type": "keyword",
3218 "ignore_above": 256
3219 }
3220 }
3221 },
3222 "tag_key_url": {
3223 "type": "keyword"
3224 }
3225 }
3226 },
3227 "part_Id": {
3228 "type": "keyword"
3229 },
3230 "part_name": {
3231 "type": "keyword"
3232 },
3233 "part_type": {
3234 "type": "keyword"
3235 },
3236 "pubdate": {
3237 "type": "keyword"
3238 },
3239 "relatedKeyWords": {
3240 "type": "nested",
3241 "properties": {
3242 "rtdkwd": {
3243 "type": "text",
3244 "analyzer": "english"
3245 },
3246 "rtdkwdId": {
3247 "type": "long"
3248 },
3249 "rtdkwd_after": {
3250 "type": "text",
3251 "fields": {
3252 "raw": {
3253 "type": "keyword",
3254 "ignore_above": 256
3255 }
3256 },
3257 "analyzer": "english"
3258 },
3259 "rtdkwdurl": {
3260 "type": "keyword"
3261 }
3262 }
3263 },
3264 "relatedTags": {
3265 "type": "nested",
3266 "properties": {
3267 "tag": {
3268 "type": "keyword"
3269 },
3270 "tagId": {
3271 "type": "long"
3272 },
3273 "tag_after": {
3274 "type": "text",
3275 "fields": {
3276 "raw": {
3277 "type": "keyword",
3278 "ignore_above": 256
3279 }
3280 },
3281 "analyzer": "english"
3282 },
3283 "tag_url": {
3284 "type": "keyword"
3285 }
3286 }
3287 },
3288 "seo_category_Id": {
3289 "type": "text",
3290 "fields": {
3291 "keyword": {
3292 "type": "keyword",
3293 "ignore_above": 256
3294 }
3295 }
3296 },
3297 "seo_category_type": {
3298 "type": "text",
3299 "fields": {
3300 "keyword": {
3301 "type": "keyword",
3302 "ignore_above": 256
3303 }
3304 }
3305 },
3306 "seo_category_url": {
3307 "type": "keyword"
3308 },
3309 "seo_part_Id": {
3310 "type": "text",
3311 "fields": {
3312 "keyword": {
3313 "type": "keyword",
3314 "ignore_above": 256
3315 }
3316 }
3317 },
3318 "seo_part_name": {
3319 "type": "text",
3320 "fields": {
3321 "keyword": {
3322 "type": "keyword",
3323 "ignore_above": 256
3324 }
3325 }
3326 },
3327 "seo_part_url": {
3328 "type": "keyword"
3329 },
3330 "taglist": {
3331 "properties": {
3332 "tag": {
3333 "type": "text",
3334 "fields": {
3335 "raw": {
3336 "type": "keyword"
3337 }
3338 }
3339 },
3340 "tagId": {
3341 "type": "long"
3342 },
3343 "tag_after": {
3344 "type": "text",
3345 "fields": {
3346 "raw": {
3347 "type": "keyword",
3348 "ignore_above": 256
3349 }
3350 }
3351 },
3352 "tag_key_url": {
3353 "type": "keyword"
3354 }
3355 }
3356 },
3357 "title": {
3358 "type": "text"
3359 },
3360 "title_en": {
3361 "type": "text",
3362 "fields": {
3363 "raw": {
3364 "type": "keyword"
3365 }
3366 },
3367 "analyzer": "english"
3368 },
3369 "update": {
3370 "properties": {
3371 "_id": {
3372 "type": "text",
3373 "fields": {
3374 "keyword": {
3375 "type": "keyword",
3376 "ignore_above": 256
3377 }
3378 }
3379 },
3380 "_index": {
3381 "type": "text",
3382 "fields": {
3383 "keyword": {
3384 "type": "keyword",
3385 "ignore_above": 256
3386 }
3387 }
3388 }
3389 }
3390 },
3391 "weekday": {
3392 "type": "text",
3393 "fields": {
3394 "keyword": {
3395 "type": "keyword",
3396 "ignore_above": 256
3397 }
3398 }
3399 }
3400 }
3401 }
3402 }
3403
3404 # seojoindata_prefix
3405 PUT seojoindata_backup
3406 {
3407 "mappings" : {
3408 "properties" : {
3409 "articleId" : {
3410 "type" : "keyword"
3411 },
3412 "article_en" : {
3413 "type" : "text",
3414 "analyzer" : "english"
3415 },
3416 "article_hot_flag" : {
3417 "type" : "long"
3418 },
3419 "article_keys" : {
3420 "type" : "text",
3421 "fields" : {
3422 "raw" : {
3423 "type" : "keyword"
3424 }
3425 }
3426 },
3427 "article_summery" : {
3428 "type" : "text",
3429 "fields" : {
3430 "raw" : {
3431 "type" : "keyword"
3432 }
3433 }
3434 },
3435 "category_Id" : {
3436 "type" : "text",
3437 "fields" : {
3438 "keyword" : {
3439 "type" : "keyword",
3440 "ignore_above" : 256
3441 }
3442 }
3443 },
3444 "category_type" : {
3445 "type" : "keyword"
3446 },
3447 "clickCount" : {
3448 "type" : "long"
3449 },
3450 "coreKeyWord" : {
3451 "type" : "nested",
3452 "properties" : {
3453 "corekwd" : {
3454 "type" : "text",
3455 "analyzer" : "english"
3456 },
3457 "corekwdId" : {
3458 "type" : "long"
3459 },
3460 "tag_key_url":{
3461 "type" : "keyword"
3462 },
3463 "corekwd_after" : {
3464 "type" : "text",
3465 "fields" : {
3466 "raw" : {
3467 "type" : "keyword",
3468 "ignore_above" : 512
3469 }
3470 },
3471 "analyzer" : "english"
3472 }
3473 }
3474 },
3475 "coreKwdCount" : {
3476 "type" : "long"
3477 },
3478 "del_flag" : {
3479 "type" : "long"
3480 },
3481 "endSource" : {
3482 "type" : "keyword"
3483 },
3484 "fullurl" : {
3485 "type" : "keyword"
3486 },
3487 "article_url":{
3488 "type": "keyword"
3489 },
3490 "is_valid" : {
3491 "type" : "long"
3492 },
3493 "model" : {
3494 "type" : "keyword"
3495 },
3496 "originalKeyWord" : {
3497 "type" : "text",
3498 "analyzer" : "english"
3499 },
3500 "otherkwdlist" : {
3501 "type" : "nested",
3502 "properties" : {
3503 "keyId" : {
3504 "type" : "long"
3505 },
3506 "keyname" : {
3507 "type" : "text",
3508 "analyzer" : "english"
3509 },
3510 "tag_key_url":{
3511 "type" : "keyword"
3512 },
3513 "keyname_after" : {
3514 "type" : "text",
3515 "fields" : {
3516 "raw" : {
3517 "type" : "keyword",
3518 "ignore_above" : 256
3519 }
3520 },
3521 "analyzer" : "english"
3522 }
3523 }
3524 },
3525 "part_Id" : {
3526 "type" : "keyword"
3527 },
3528 "part_name" : {
3529 "type" : "keyword"
3530 },
3531 "part_type" : {
3532 "type" : "keyword"
3533 },
3534 "pubdate" : {
3535 "type" : "keyword"
3536 },
3537 "relatedKeyWords" : {
3538 "type" : "nested",
3539 "properties" : {
3540 "rtdkwd" : {
3541 "type" : "text",
3542 "analyzer" : "english"
3543 },
3544 "rtdkwdId" : {
3545 "type" : "long"
3546 },
3547 "rtdkwdurl":{
3548 "type":"keyword"
3549 },
3550 "rtdkwd_after" : {
3551 "type" : "text",
3552 "fields" : {
3553 "raw" : {
3554 "type" : "keyword",
3555 "ignore_above" : 256
3556 }
3557 },
3558 "analyzer" : "english"
3559 }
3560 }
3561 },
3562 "relatedTags" : {
3563 "type" : "nested",
3564 "properties" : {
3565 "tag" : {
3566 "type" : "keyword"
3567 },
3568 "tagId" : {
3569 "type" : "long"
3570 },
3571 "tag_url":{
3572 "type" : "keyword"
3573 },
3574 "tag_after" : {
3575 "type" : "text",
3576 "fields" : {
3577 "raw" : {
3578 "type" : "keyword",
3579 "ignore_above" : 256
3580 }
3581 },
3582 "analyzer" : "english"
3583 }
3584 }
3585 },
3586 "seo_category_url":{
3587 "type" : "keyword"
3588 },
3589 "seo_category_Id" : {
3590 "type" : "text",
3591 "fields" : {
3592 "keyword" : {
3593 "type" : "keyword",
3594 "ignore_above" : 256
3595 }
3596 }
3597 },
3598 "seo_category_type" : {
3599 "type" : "text",
3600 "fields" : {
3601 "keyword" : {
3602 "type" : "keyword",
3603 "ignore_above" : 256
3604 }
3605 }
3606 },
3607 "seo_part_url":{
3608 "type" : "keyword"
3609 },
3610 "seo_part_Id" : {
3611 "type" : "text",
3612 "fields" : {
3613 "keyword" : {
3614 "type" : "keyword",
3615 "ignore_above" : 256
3616 }
3617 }
3618 },
3619 "seo_part_name" : {
3620 "type" : "text",
3621 "fields" : {
3622 "keyword" : {
3623 "type" : "keyword",
3624 "ignore_above" : 256
3625 }
3626 }
3627 },
3628 "taglist" : {
3629 "properties" : {
3630 "tag" : {
3631 "type" : "text",
3632 "fields" : {
3633 "raw" : {
3634 "type" : "keyword"
3635 }
3636 }
3637 },
3638 "tag_key_url":{
3639 "type" : "keyword"
3640 },
3641 "tagId" : {
3642 "type" : "long"
3643 },
3644 "tag_after" : {
3645 "type" : "text",
3646 "fields" : {
3647 "raw" : {
3648 "type" : "keyword",
3649 "ignore_above" : 256
3650 }
3651 }
3652 }
3653 }
3654 },
3655 "title" : {
3656 "type" : "text"
3657 },
3658 "title_en" : {
3659 "type" : "text",
3660 "fields" : {
3661 "raw" : {
3662 "type" : "keyword"
3663 }
3664 },
3665 "analyzer" : "english"
3666 }
3667 }
3668 }
3669 }
3670
3671
3672
3673
3674 GET seokeytagsdata/_search
3675 {
3676 "track_total_hits": true,
3677 "size": 1000,
3678 "query": {
3679 "bool": {
3680 "must": [
3681 {
3682 "term": {
3683 "keywords_type": {
3684 "value": 0
3685 }
3686 }
3687 },
3688 {
3689 "range": {
3690 "match_count": {
3691 "gte": 5
3692 }
3693 }
3694 }
3695 ]
3696 }
3697 },
3698 "_source": {
3699 "includes": ["corekwdId","corekwd","match_count"]
3700 }
3701 }
3702
3703
3704 GET seojoindata/_search
3705 {
3706 "size": 0,
3707 "query": {
3708 "bool": {
3709 "must": [
3710 {
3711 "exists": {
3712 "field": "taglist.tagId"
3713 }
3714 },
3715 {
3716 "nested": {
3717 "path": "coreKeyWord",
3718 "query": {
3719 "exists": {
3720 "field": "coreKeyWord.corekwdId"
3721 }
3722 }
3723 }
3724 },
3725 {
3726 "term": {
3727 "is_valid": {
3728 "value": 1
3729 }
3730 }
3731 },
3732 {
3733 "exists": {
3734 "field": "article_en"
3735 }
3736 },
3737 {
3738 "exists": {
3739 "field": "title_en"
3740 }
3741 },
3742 {
3743 "exists": {
3744 "field": "seo_part_Id"
3745 }
3746 }
3747 ]
3748 }
3749 },
3750 "aggs": {
3751 "group_by_part": {
3752 "terms": {
3753 "field": "seo_part_name.keyword",
3754 "size": 100
3755 },
3756 "aggs": {
3757 "group_by_part_Id": {
3758 "terms": {
3759 "field": "seo_part_Id.keyword",
3760 "size": 1
3761 }
3762 }
3763 }
3764 }
3765 }
3766 }
3767
3768 GET seojoindata/_search
3769 {
3770 "size": 0,
3771 "query": {
3772 "bool": {
3773 "filter": {
3774 "term": {
3775 "is_valid": 1
3776 }
3777 }
3778 }
3779 },
3780 "aggs": {
3781 "group_by_category_type": {
3782 "terms": {
3783 "field": "seo_category_type.keyword",
3784 "size": 100
3785 },
3786 "aggs": {
3787 "show_category_Id": {
3788 "terms": {
3789 "field": "seo_category_Id.keyword",
3790 "size": 100
3791 }
3792 }
3793 }
3794 }
3795 }
3796 }
3797 # 72715
3798 # 1990
3799 GET seokeytagsdata/_search
3800 {
3801 "query": {
3802 "term": {
3803 "corekwdId": {
3804 "value": 853202
3805 }
3806 }
3807 }
3808 }
3809
3810
3811 GET seojoindata/_search
3812 {
3813 "track_total_hits": true,
3814 "size": 5000,
3815 "query": {
3816 "bool": {
3817 "must": [
3818 {
3819 "exists": {
3820 "field": "taglist.tagId"
3821 }
3822 },
3823 {
3824 "exists": {
3825 "field": "article_en"
3826 }
3827 },
3828 {
3829 "nested": {
3830 "path": "coreKeyWord",
3831 "query": {
3832 "bool": {
3833 "must": [
3834 {
3835 "exists": {
3836 "field": "coreKeyWord.corekwdId"
3837 }
3838 }
3839 ]
3840 }
3841 }
3842 }
3843 }
3844 ]
3845 }
3846 },
3847 "_source": {
3848 "includes": [
3849 "title_en","articleId"
3850 ]
3851 }
3852 }
3853
3854
3855 GET seojoindata/_search
3856 {
3857 "query": {
3858 "term": {
3859 "articleId": {
3860 "value": "5e5cb407ac4d35eb38becc30"
3861 }
3862 }
3863 },
3864 "_source": ["title_en","fullurl","title"]
3865 }
3866
3867 GET seojoindata/_search
3868 {
3869 "query": {
3870 "bool": {
3871 "must": [
3872 {
3873 "exists": {
3874 "field": "taglist.tagId"
3875 }
3876 },
3877 {
3878 "exists": {
3879 "field": "article_en"
3880 }
3881 },
3882 {
3883 "nested": {
3884 "path": "coreKeyWord",
3885 "query": {
3886 "exists": {
3887 "field": "coreKeyWord.corekwdId"
3888 }
3889 }
3890 }
3891 },
3892 {
3893 "term": {
3894 "articleId": {
3895 "value": "5e54d3dbd515cd71ed25571d"
3896 }
3897 }
3898 },
3899 {
3900 "nested": {
3901 "path": "coreKeyWord",
3902 "query": {
3903 "term": {
3904 "coreKeyWord.corekwd_after.raw": {
3905 "value": "zirconium orbital diagram"
3906 }
3907 }
3908 }
3909 }
3910 }
3911 ]
3912 }
3913 },
3914 "_source": {
3915 "excludes": [
3916 "fullurl",
3917 "model",
3918 "title",
3919 "endSource"
3920 ]
3921 },
3922 "highlight": {
3923 "no_match_size": 180,
3924 "number_of_fragments": 4,
3925 "pre_tags": [
3926 "<span>"
3927 ],
3928 "post_tags": [
3929 "</span>"
3930 ],
3931 "fields": {
3932 "article_en": {
3933 "type": "plain"
3934 }
3935 }
3936 }
3937 }
3938
3939 GET seojoindata/_search
3940 {
3941 "query": {
3942 "term": {
3943 "articleId": {
3944 "value": "5e563ab6e42464a085d77657"
3945 }
3946 }
3947 }
3948 }
3949
3950
3951 GET seojoindata/_search
3952 {
3953 "track_total_hits": true,
3954 "query": {
3955 "bool": {
3956 "must": [
3957 {
3958 "exists": {
3959 "field": "taglist.tagId"
3960 }
3961 },
3962 {
3963 "exists": {
3964 "field": "article_en"
3965 }
3966 },
3967 {
3968 "nested": {
3969 "path": "coreKeyWord",
3970 "query": {
3971 "exists": {
3972 "field": "coreKeyWord.corekwdId"
3973 }
3974 }
3975 }
3976 },
3977 {
3978 "term": {
3979 "taglist.tag_after.raw": {
3980 "value": "dme solvent"
3981 }
3982 }
3983 }
3984 ]
3985 }
3986 },
3987 "_source": {
3988 "includes": [
3989 "title_en",
3990 "articleId",
3991 "part_Id",
3992 "part_name",
3993 "category_type",
3994 "category_Id",
3995 "seo_part_Id",
3996 "seo_part_name",
3997 "seo_category_type",
3998 "seo_category_Id",
3999 "article_summery",
4000 "taglist",
4001 "pubdate",
4002 "clickCount"
4003 ]
4004 },
4005 "highlight": {
4006 "fields": {
4007 "article_en": {
4008 "type": "plain",
4009 "number_of_fragments": 4,
4010 "pre_tags": [
4011 "<span>"
4012 ],
4013 "post_tags": [
4014 "</span>"
4015 ],
4016 "no_match_size": 180
4017 },
4018 "title_en": {
4019 "type": "plain",
4020 "no_match_size": 800,
4021 "pre_tags": [
4022 "<span>"
4023 ],
4024 "post_tags": [
4025 "</span>"
4026 ]
4027 }
4028 }
4029 }
4030 }
4031
4032
4033 GET seojoindata/_search
4034 {
4035 "query": {
4036 "bool": {
4037 "must": [
4038 {
4039 "nested": {
4040 "path": "coreKeyWord",
4041 "query": {
4042 "term": {
4043 "coreKeyWord.corekwd_after.raw": {
4044 "value": "darrow yannet diagram"
4045 }
4046 }
4047 }
4048 }
4049 }
4050 ]
4051 }
4052 }
4053 }
4054
4055
4056 GET seojoindata/_mapping
4057
4058 GET seojoindata/_search
4059 {
4060 "query": {
4061 "match_all": {}
4062 },
4063 "_source": "article_summery"
4064 }
4065
4066 GET seojoindata/_search
4067 {
4068 "query": {
4069 "term": {
4070 "article_en": {
4071 "value": ""
4072 }
4073 }
4074 }
4075 }
4076
4077 # 5e573f22abe6408d7b0d52b7
4078 GET seojoindata/_search
4079 {
4080 "query": {
4081 "bool": {
4082 "must": [
4083 {
4084 "term": {
4085 "articleId": {
4086 "value": "5e5fcfe38b83f7500c76786c"
4087 }
4088 }
4089 },
4090 {
4091 "nested": {
4092 "path": "coreKeyWord",
4093 "query": {
4094 "term": {
4095 "coreKeyWord.corekwd_after.raw": {
4096 "value": "wss m6c65 a2 dot 4 lv"
4097 }
4098 }
4099 }
4100 }
4101 }
4102 ]
4103 }
4104 },
4105 "_source": {
4106 "excludes": [
4107 "fullurl",
4108 "model",
4109 "title",
4110 "endSource"
4111 ]
4112 },
4113 "highlight": {
4114 "no_match_size": 180,
4115 "number_of_fragments": 4,
4116 "pre_tags": [
4117 "<span>"
4118 ],
4119 "post_tags": [
4120 "</span>"
4121 ],
4122 "fields": {
4123 "article_en": {
4124 "type": "plain"
4125 }
4126 }
4127 }
4128 }
4129
4130 GET seojoindata/_search
4131 {
4132 "query": {
4133 "term": {
4134 "articleId": {
4135 "value": "5e5fcfe38b83f7500c76786c"
4136 }
4137 }
4138 }
4139 }
4140
4141 GET seojoindata/_search
4142 {
4143 "track_total_hits": true,
4144 "size": 0,
4145 "query": {
4146 "bool": {
4147 "must": [
4148 {
4149 "term": {
4150 "taglist.tagId": {
4151 "value": 1559977
4152 }
4153 }
4154 }
4155 ]
4156 }
4157 }
4158 }
4159
4160
4161 GET seojoindata/_search
4162 {
4163 "query": {
4164 "bool": {
4165 "must": [
4166 {
4167 "term": {
4168 "endSource": {
4169 "value": "www.bbaqw.com"
4170 }
4171 }
4172 },
4173 {
4174 "term": {
4175 "model": {
4176 "value": "营养强化剂"
4177 }
4178 }
4179 }
4180 ]
4181 }
4182 }
4183
4184 }
4185
4186
4187 GET seokeytagsdata_back/_search
4188 {
4189 "track_total_hits": true,
4190 "query": {
4191 "bool": {
4192 "must": [
4193 {
4194 "term": {
4195 "keywords_type": {
4196 "value": 0
4197 }
4198 }
4199 },
4200 {
4201 "exists": {
4202 "field": "key_title"
4203 }
4204 }
4205 ]
4206 }
4207 }
4208 }
4209
4210
4211 GET seokeytagsdata_back/_search
4212 {
4213 "track_total_hits": true,
4214 "query": {
4215 "bool": {
4216 "must": [
4217 {
4218 "exists": {
4219 "field": "key_title"
4220 }
4221 },
4222 {
4223 "term": {
4224 "keywords_type": {
4225 "value": 1
4226 }
4227 }
4228 }
4229 ]
4230 }
4231 }
4232 }
4233
4234
4235 PUT seokeytagsdata
4236 {
4237 "mappings" : {
4238 "properties" : {
4239 "after_keytag" : {
4240 "type" : "text",
4241 "fields" : {
4242 "raw" : {
4243 "type" : "keyword"
4244 }
4245 },
4246 "analyzer" : "english"
4247 },
4248 "clickCount" : {
4249 "type" : "long"
4250 },
4251 "corekwd" : {
4252 "type" : "text",
4253 "fields" : {
4254 "raw" : {
4255 "type" : "keyword"
4256 }
4257 },
4258 "analyzer" : "english"
4259 },
4260 "corekwdId" : {
4261 "type" : "long"
4262 },
4263 "del_flag" : {
4264 "type" : "long"
4265 },
4266 "key_desc" : {
4267 "type" : "text",
4268 "fields" : {
4269 "keyword" : {
4270 "type" : "keyword",
4271 "ignore_above" : 256
4272 }
4273 }
4274 },
4275 "key_title" : {
4276 "type" : "text",
4277 "fields" : {
4278 "keyword" : {
4279 "type" : "keyword",
4280 "ignore_above" : 256
4281 }
4282 }
4283 },
4284 "keywords_type" : {
4285 "type" : "long"
4286 },
4287 "match_count" : {
4288 "type" : "long"
4289 }
4290 }
4291 }
4292 }
4293
4294
4295 GET seojoindata/_search
4296 {
4297 "size": 0,
4298 "query": {
4299 "bool": {
4300 "must": [
4301 {
4302 "term": {
4303 "is_valid": {
4304 "value": 1
4305 }
4306 }
4307 },
4308 {
4309 "exists": {
4310 "field": "article_en"
4311 }
4312 },
4313 {
4314 "exists": {
4315 "field": "title_en"
4316 }
4317 },
4318 {
4319 "exists": {
4320 "field": "seo_part_Id"
4321 }
4322 }
4323 ]
4324 }
4325 },
4326 "aggs": {
4327 "group_by_part": {
4328 "terms": {
4329 "field": "seo_part_name.keyword",
4330 "size": 100
4331 },
4332 "aggs": {
4333 "group_by_part_Id": {
4334 "terms": {
4335 "field": "seo_part_Id.keyword",
4336 "size": 1
4337 }
4338 }
4339 }
4340 }
4341 }
4342 }
4343
4344
4345 GET seojoindata/_search
4346 {
4347 "size": 0,
4348 "query": {
4349 "bool": {
4350 "must": [
4351 {
4352 "term": {
4353 "seo_part_Id.keyword": "seoc2129_1"
4354 }
4355 },
4356 {
4357 "exists": {
4358 "field": "title_en"
4359 }
4360 },
4361 {
4362 "exists": {
4363 "field": "article_en"
4364 }
4365 }
4366
4367 ]
4368 }
4369 },
4370 "aggs": {
4371 "group_by_tags": {
4372 "terms": {
4373 "field": "taglist.tag.raw",
4374 "size": 10
4375 },
4376 "aggs": {
4377 "group_by_tagId": {
4378 "terms": {
4379 "field": "taglist.tagId",
4380 "size": 1
4381 }
4382 }
4383 }
4384 }
4385 }
4386 }
4387
4388
4389 GET seojoindata/_search
4390 {
4391 "track_total_hits": true,
4392 "query": {
4393 "bool": {
4394 "must": [
4395 {
4396 "term": {
4397 "taglist.tag_after.raw": {
4398 "value": "fda organizational chart"
4399 }
4400 }
4401 }
4402 ]
4403 }
4404 },
4405 "_source": {
4406 "includes": [
4407 "title_en",
4408 "articleId",
4409 "part_Id",
4410 "part_name",
4411 "category_type",
4412 "category_Id",
4413 "seo_part_Id",
4414 "seo_part_name",
4415 "seo_category_type",
4416 "seo_category_Id",
4417 "article_summery",
4418 "taglist",
4419 "pubdate",
4420 "clickCount"
4421 ]
4422 },
4423 "highlight": {
4424 "fields": {
4425 "article_en": {
4426 "type": "plain",
4427 "number_of_fragments": 4,
4428 "pre_tags": [
4429 "<span>"
4430 ],
4431 "post_tags": [
4432 "</span>"
4433 ],
4434 "no_match_size": 180
4435 },
4436 "title_en": {
4437 "no_match_size": 800,
4438 "type": "plain",
4439 "pre_tags": [
4440 "<span>"
4441 ],
4442 "post_tags": [
4443 "</span>"
4444 ]
4445 }
4446 }
4447 }
4448 }
4449
4450 GET seojoindata/_search
4451 {
4452 "query": {
4453 "bool": {
4454 "must": [
4455 {
4456 "match": {
4457 "title_en": {
4458 "query": "2b gel",
4459 "minimum_should_match": "50%"
4460 }
4461 }
4462 }
4463 ]
4464 }
4465 },
4466 "_source": {
4467 "includes": [
4468 "articleId",
4469 "title_en",
4470 "clickCount",
4471 "article_summery",
4472 "pubdate"
4473 ]
4474 },
4475 "highlight": {
4476 "fields": {
4477 "article_en": {
4478 "type": "plain",
4479 "number_of_fragments": 4,
4480 "pre_tags": ["<span>"],
4481 "post_tags": ["</span>"],
4482 "no_match_size": 180
4483 },
4484 "title_en": {
4485 "type": "plain",
4486 "pre_tags": ["<span>"],
4487 "post_tags": ["</span>"]
4488 }
4489 }
4490 }
4491 }
4492
4493 GET seokeytagsdata/_mapping
4494
4495 GET /seokeytagsdata/_count
4496 GET /seojoindata/_count
4497 GET /seokeytagsdata/_search
4498 {
4499 "query": {
4500 "term": {
4501 "corekwdId": {
4502 "value": 909227
4503 }
4504 }
4505 }
4506 }
4507
4508
4509
4510 GET /seokeytagsdata/_search
4511 {
4512 "track_total_hits": true,
4513 "query": {
4514 "bool": {
4515 "must": [
4516 {
4517 "range": {
4518 "match_count": {
4519 "gte": 1
4520 }
4521 }
4522 },
4523 {
4524 "term": {
4525 "keywords_type": {
4526 "value": 1
4527 }
4528 }
4529 }
4530
4531 ]
4532 }
4533 }
4534 }
4535
4536 GET /seojoindata/_mapping
4537 GET seojoindata_back/
4538
4539
4540 GET seojoindata/_search
4541 {
4542 "track_total_hits": true,
4543 "query": {
4544 "bool": {
4545 "must": [
4546 {
4547 "exists": {
4548 "field": "taglist"
4549 }
4550 },
4551 {
4552 "exists": {
4553 "field": "title_en"
4554 }
4555 },
4556 {
4557 "terms": {
4558 "seo_part_Id.keyword": [
4559 "seoc2129"
4560 ]
4561 }
4562 }
4563 ]
4564 }
4565 }
4566 }
4567
4568 # 查询文章关键词
4569 GET seojoindata/_search
4570 {
4571 "query": {
4572 "bool": {
4573 "must": [
4574 {
4575 "term": {
4576 "articleId": {
4577 "value": "5e5efec3bdee44a1d6e79df3"
4578 }
4579 }
4580 },
4581 {
4582 "nested": {
4583 "path": "coreKeyWord",
4584 "query": {
4585 "bool": {
4586 "must": [
4587 {
4588 "exists": {
4589 "field": "coreKeyWord.corekwdId"
4590 }
4591 }
4592 ]
4593 }
4594 }
4595 }
4596 }
4597 ]
4598 }
4599 },
4600 "_source": {
4601 "includes": [
4602 "coreKeyWord"
4603 ]
4604 }
4605 }
4606
4607
4608 GET seojoindata/_search
4609 {
4610 "size": 0,
4611 "query": {
4612 "bool": {
4613 "must": [
4614 {
4615 "term": {
4616 "seo_part_Id.keyword": "seoc25_2"
4617 }
4618 },
4619 {
4620 "exists": {
4621 "field": "title_en"
4622 }
4623 },
4624 {
4625 "exists": {
4626 "field": "article_en"
4627 }
4628 }
4629 ]
4630 }
4631 },
4632 "aggs": {
4633 "group_by_tags": {
4634 "terms": {
4635 "field": "taglist.tag.raw",
4636 "size": 10
4637 },
4638 "aggs": {
4639 "group_by_tagId": {
4640 "terms": {
4641 "field": "taglist.tagId",
4642 "size": 1
4643 }
4644 }
4645 }
4646 }
4647 }
4648 }
4649
4650 GET seojoindata/_search
4651 {
4652 "query": {
4653 "bool": {
4654 "must": [
4655 {
4656 "term": {
4657 "articleId": {
4658 "value": "5e5efec3bdee44a1d6e79df3"
4659 }
4660 }
4661 },
4662 {
4663 "nested": {
4664 "path": "coreKeyWord",
4665 "query": {
4666 "term": {
4667 "coreKeyWord.corekwd_after.raw": {
4668 "value": "zinc oxide nanoparticles research paper"
4669 }
4670 }
4671 }
4672 }
4673 }
4674 ]
4675 }
4676 },
4677 "_source": {
4678 "includes": [
4679 "coreKeyWord",
4680 "otherkwdlist"
4681 ]
4682 },
4683 "highlight": {
4684 "fields": {
4685 "article_en": {
4686 "type": "plain",
4687 "number_of_fragments": 4,
4688 "pre_tags": [
4689 "<span>"
4690 ],
4691 "post_tags": [
4692 "</span>"
4693 ],
4694 "no_match_size": 180
4695 }
4696 }
4697 }
4698 }
4699
4700
4701
4702
4703
4704
4705 GET seojoindata/_search
4706 {
4707 "track_total_hits": true,
4708 "query": {
4709 "bool": {
4710 "must": [
4711 {
4712 "term": {
4713 "endSource": {
4714 "value": "peptide.org.cn"
4715 }
4716 }
4717 },
4718 {
4719 "term": {
4720 "part_Id": {
4721 "value": "c1522"
4722 }
4723 }
4724 }
4725 ]
4726 }
4727 }
4728 }
4729
4730
4731
4732
4733
4734 GET seojoindata/_search
4735 {
4736 "query": {
4737 "bool": {
4738 "must": [
4739 {
4740 "term": {
4741 "articleId": {
4742 "value": "5e4f90f9d515cd752334603f"
4743 }
4744 }
4745 }
4746 ]
4747 }
4748 },
4749 "_source": {
4750 "excludes": [
4751 "fullurl",
4752 "model",
4753 "title",
4754 "endSource"
4755 ]
4756 }
4757 }
4758
4759 GET seojoindata/_search
4760 {
4761 "track_total_hits": true,
4762 "size": 10,
4763 "query": {
4764 "bool": {
4765 "must": [
4766 {
4767 "term": {
4768 "taglist.tagId": {
4769 "value": 891305
4770 }
4771 }
4772 }
4773 ]
4774 }
4775 }
4776 }
4777
4778 GET seojoindata/_search
4779 {
4780 "query": {
4781 "term": {
4782 "taglist.tag.raw": "fda organizational chart"
4783 }
4784 },
4785 "_source": [
4786 "coreKeyWord",
4787 "originalKeyWord",
4788 "articleId"
4789 ]
4790 }
4791
4792 # 查询关键词
4793 GET seojoindata/_search
4794 {
4795 "size": 0,
4796 "query": {
4797 "bool": {
4798 "must": [
4799 {
4800 "term": {
4801 "seo_part_Id.keyword": "seoc1431"
4802 }
4803 },
4804 {
4805 "term": {
4806 "is_valid": {
4807 "value": 1
4808 }
4809 }
4810 }
4811 ]
4812 }
4813 },
4814 "aggs": {
4815 "group_by_tags": {
4816 "terms": {
4817 "field": "taglist.tag.raw",
4818 "size": 10
4819 },
4820 "aggs": {
4821 "group_by_tagId": {
4822 "terms": {
4823 "field": "taglist.tagId",
4824 "size": 1
4825 }
4826 }
4827 }
4828 }
4829 }
4830 }
4831
4832 GET seojoindata/_search
4833 {
4834 "size": 0,
4835 "query": {
4836 "bool": {
4837 "must": [
4838 {
4839 "term": {
4840 "seo_part_Id.keyword": "seoc1420"
4841 }
4842 },
4843 {
4844 "term": {
4845 "is_valid": {
4846 "value": 1
4847 }
4848 }
4849 }
4850 ]
4851 }
4852 },
4853 "aggs": {
4854 "group_by_tags": {
4855 "terms": {
4856 "field": "taglist.tag.raw",
4857 "size": 10
4858 },
4859 "aggs": {
4860 "group_by_tagId": {
4861 "terms": {
4862 "field": "taglist.tagId",
4863 "size": 1
4864 }
4865 }
4866 }
4867 }
4868 }
4869 }
4870
4871 GET seojoindata/_search
4872 {
4873 "track_total_hits": true,
4874 "from": 0,
4875 "size": 20,
4876 "query": {
4877 "bool": {
4878 "filter": {
4879 "term": {
4880 "seo_part_Id.keyword": "seoc1420"
4881 }
4882 },
4883 "must": [
4884 {
4885 "term": {
4886 "is_valid": {
4887 "value": 1
4888 }
4889 }
4890 },
4891 {
4892 "exists": {
4893 "field": "article_summery"
4894 }
4895 },
4896 {
4897 "exists": {
4898 "field": "taglist.tag"
4899 }
4900 }
4901 ]
4902 }
4903 },
4904 "sort": [
4905 {
4906 "pubdate": {
4907 "order": "desc"
4908 }
4909 }
4910 ],
4911 "_source": {
4912 "excludes": [
4913 "article_en",
4914 "title",
4915 "article_keys",
4916 "fullurl",
4917 "endSource",
4918 "originalKeyWord",
4919 "model",
4920 "coreKeyWord",
4921 "clickCount"
4922 ]
4923 }
4924 }
4925
4926
4927
4928 GET seojoindata/_search
4929 {
4930 "query": {
4931 "bool": {
4932 "must": [
4933 {
4934 "term": {
4935 "taglist.tag_after.raw": {
4936 "value": "alendronate used for"
4937 }
4938 }
4939 }
4940 ]
4941 }
4942 },
4943 "_source": "taglist"
4944 }
4945
4946
4947 GET seojoindata/_search
4948 {
4949 "size": 200,
4950 "query": {
4951 "bool": {
4952 "should": [
4953 {
4954 "match": {
4955 "title_en": {
4956 "query": "alendronate used for",
4957 "analyzer": "english",
4958 "minimum_should_match": "80%"
4959 }
4960 }
4961 },
4962 {
4963 "match": {
4964 "article_en": {
4965 "query": "alendronate used for",
4966 "analyzer": "english",
4967 "minimum_should_match": "80%"
4968 }
4969 }
4970 }
4971 ]
4972 }
4973 },
4974 "_source": {
4975 "excludes": [
4976 "article_en",
4977 "otherkwdlist",
4978 "coreKeyWord",
4979 "fullurl",
4980 "article_keys",
4981 "article_summery",
4982 "endSource",
4983 "model",
4984 "title"
4985 ]
4986 }
4987 }
4988
4989 GET seojoindata/_search
4990 {
4991 "size": 200,
4992 "query": {
4993 "bool": {
4994 "should": [
4995 {
4996 "match": {
4997 "title_en": {
4998 "query": "alendronate used for",
4999 "analyzer": "english",
5000 "minimum_should_match": "80%"
5001 }
5002 }
5003 },
5004 {
5005 "match_phrase": {
5006 "title_en": {
5007 "query": "alendronate used for",
5008 "analyzer": "english",
5009 "slop": 5
5010 }
5011 }
5012 },
5013 {
5014 "match_phrase": {
5015 "article_en": {
5016 "query": "alendronate used for",
5017 "analyzer": "english",
5018 "slop": 3
5019 }
5020 }
5021 },
5022 {
5023 "match": {
5024 "article_en": {
5025 "query": "alendronate used for",
5026 "analyzer": "english",
5027 "minimum_should_match": "80%"
5028 }
5029 }
5030 }
5031 ]
5032 }
5033 },
5034 "_source": {
5035 "excludes": [
5036 "article_en",
5037 "otherkwdlist",
5038 "coreKeyWord",
5039 "fullurl",
5040 "article_keys",
5041 "article_summery",
5042 "endSource",
5043 "model",
5044 "title"
5045 ]
5046 }
5047 }
5048
5049 GET seojoindata/_search
5050 {
5051 "query": {
5052 "match_all": {}
5053 }
5054 }
5055
5056
5057 GET seojoindata/_search
5058 {
5059 "query": {
5060 "bool": {
5061 "must": [
5062 {
5063 "term": {
5064 "articleId": {
5065 "value": "5e57410cabe6408d7b0d53bd"
5066 }
5067 }
5068 }
5069 ]
5070 }
5071 }
5072 }
5073
5074
5075 GET seojoindata/_search
5076 {
5077 "track_total_hits": true,
5078 "size": 0,
5079 "query": {
5080 "bool": {
5081 "must": [
5082 {
5083 "exists": {
5084 "field": "taglist"
5085 }
5086 },
5087 {
5088 "term": {
5089 "taglist.tag.raw": {
5090 "value": "1 bromopropane"
5091 }
5092 }
5093 }
5094 ]
5095 }
5096 }
5097 }
5098
5099 GET seojoindata/_search
5100 {
5101 "query": {
5102 "term": {
5103 "articleId": {
5104 "value": "5e5fd6348b83f7500c767d56"
5105 }
5106 }
5107 }
5108 }
5109 # 5e549e01d515cd71ed253be3
5110 # 5e549e01d515cd71ed253be3
5111
5112 # PD-L1/PD-1 axis in GBM
5113
5114 GET seojoindata/_search
5115 {"query": {"term": {"articleId": "5ed0beebf0d4878c0ae54101"}}, "_source": ["articleId","title_en"]}
5116
5117 #{"query": {"term": {"trans_date": {"value": "2020-06-01"}}}}
5118
5119 POST seojoindata/_update_by_query
5120 {
5121 "script": {
5122 "source": "ctx._source.title_en='PD-L1/PD-1 axis in GBM';",
5123 "lang": "painless"
5124 },
5125 "query": {
5126 "term": {
5127 "articleId": "5ed0beebf0d4878c0ae54101"
5128 }
5129 }
5130 }
5131
5132 # 239500
5133 POST seokeytagsdata/_update_by_query
5134 {
5135 "script": {
5136 "source": "ctx._source.match_count=0;",
5137 "lang": "painless"
5138 },
5139 "query": {
5140 "bool": {
5141 "must": [
5142 {
5143 "term": {
5144 "corekwdId": {
5145 "value": 21741
5146 }
5147 }
5148 },
5149 {
5150 "term": {
5151 "keywords_type": {
5152 "value": 1
5153 }
5154 }
5155 }
5156 ]
5157 }
5158 }
5159 }
5160
5161
5162 GET seokeytagsdata/_search
5163 {
5164 "track_total_hits": true,
5165 "size": 0,
5166 "query": {
5167 "bool": {
5168 "must": [
5169 {
5170 "range": {
5171 "match_count": {
5172 "gte": 5
5173 }
5174 }
5175 },
5176 {
5177 "term": {
5178 "keywords_type": {
5179 "value": 1
5180 }
5181 }
5182 }
5183 ]
5184 }
5185 },
5186 "aggs": {
5187 "group_by_click": {
5188 "top_hits": {
5189 "size": 10,
5190 "sort": [
5191 {
5192 "clickCount": {
5193 "order": "desc"
5194 }
5195 }
5196 ],
5197 "_source": {
5198 "includes": [
5199 "corekwdId",
5200 "corekwd",
5201 "clickCount"
5202 ]
5203 }
5204 }
5205 }
5206 }
5207 }
5208
5209
5210
5211
5212 GET seokeytagsdata/_search
5213 {
5214 "track_total_hits": true,
5215 "query": {
5216 "term": {
5217 "corekwd.raw": {
5218 "value": "alendronate used for"
5219 }
5220 }
5221 }
5222 }
5223
5224
5225
5226
5227 GET seokeytagsdata/_search
5228 {
5229 "query": {
5230 "term": {
5231 "match_count": {
5232 "value": 0
5233 }
5234 }
5235 },
5236 "_source": ["keywords_type","match_count"]
5237 }
5238
5239 # 查询tag词
5240 GET seokeytagsdata/_search
5241 {
5242 "query": {
5243 "bool": {
5244 "must": [
5245 {
5246 "term": {
5247 "keywords_type": {
5248 "value": 1
5249 }
5250 }
5251 },
5252 {
5253 "terms": {
5254 "corekwd.raw": [
5255 "benadryl cream ingredients"
5256 ]
5257 }
5258 }
5259 ]
5260 }
5261 },
5262 "_source": {
5263 "includes": [
5264 "corekwd",
5265 "corekwdId",
5266 "after_keytag",
5267 "keywords_type",
5268 "clickCount",
5269 "match_count"
5270 ]
5271 }
5272 }
5273
5274 GET seojoindata_back/_search
5275 {
5276 "query": {
5277 "match_all": {}
5278 },
5279 "_source": {
5280 "includes": ["taglist","coreKeyWord","otherkwdlist","originalKeyWord"]
5281 }
5282 }
5283
5284 GET seojoindata_back/_search
5285 {
5286 "query": {
5287 "bool": {
5288 "must": [
5289 {
5290 "nested": {
5291 "path": "coreKeyWord",
5292 "query": {
5293 "exists": {
5294 "field": "coreKeyWord.corekwd_after"
5295 }
5296 }
5297 }
5298 }
5299 ]
5300 }
5301 },
5302 "_source": {
5303 "includes": ["taglist","coreKeyWord","otherkwdlist","originalKeyWord"]
5304 }
5305 }
5306
5307
5308 GET seokeytagsdata/_search
5309 {
5310 "track_total_hits": true,
5311 "size": 0,
5312 "query": {
5313 "bool": {
5314 "must": [
5315 {
5316 "range": {
5317 "match_count": {
5318 "gte": 5
5319 }
5320 }
5321 },
5322 {
5323 "term": {
5324 "keywords_type": {
5325 "value": 1
5326 }
5327 }
5328 }
5329 ]
5330 }
5331 },
5332 "aggs": {
5333 "group_by_click":{
5334 "top_hits": {
5335 "size": 10,
5336 "sort": [
5337 {
5338 "clickCount": {
5339 "order": "desc"
5340 }
5341 }
5342 ],
5343 "_source": {
5344 "includes": ["corekwdId","corekwd","clickCount"]
5345 }
5346 }
5347 }
5348 }
5349 }
5350
5351 # 对tag词进行聚合 统计每个词的数量
5352 GET /seojoindata/_search
5353 {
5354 "size": 0,
5355 "query": {
5356 "bool": {
5357 "must": [
5358 {
5359 "term": {
5360 "is_valid": {
5361 "value": 1
5362 }
5363 }
5364 },
5365 {
5366 "term": {
5367 "seo_category_Id.keyword": {
5368 "value": "seoc14"
5369 }
5370 }
5371 }
5372 ]
5373 }
5374 },
5375 "aggs": {
5376 "group_by_tag_name": {
5377 "terms": {
5378 "field": "taglist.tag.raw",
5379 "size": 10
5380 },
5381 "aggs": {
5382 "group_by_tag_Id": {
5383 "terms": {
5384 "field": "taglist.tagId",
5385 "size": 1
5386 }
5387 }
5388 }
5389 }
5390 }
5391 }
5392
5393 GET /seojoindata/_search
5394 {
5395 "query": {
5396 "match_all": {}
5397 },
5398 "_source": "clickCount"
5399 }
5400
5401 GET /seojoindata/_search
5402 {
5403 "track_total_hits": true,
5404 "size": 0,
5405 "aggs": {
5406 "group_by_tag_name": {
5407 "terms": {
5408 "field": "taglist.tag.raw",
5409 "size": 5000
5410 }
5411 }
5412 }
5413 }
5414
5415 #
5416 GET /seojoindata/_search
5417 {
5418 "track_total_hits": true,
5419 "size": 0,
5420 "query": {
5421 "bool": {
5422 "must": [
5423 {
5424 "exists": {
5425 "field": "taglist"
5426 }
5427 },
5428 {
5429 "term": {
5430 "taglist.tag.raw": {
5431 "value": "dollywood"
5432 }
5433 }
5434 }
5435 ]
5436 }
5437 }
5438 }
5439
5440
5441 GET seojoindata/_search
5442 {
5443 "track_total_hits": true,
5444 "query": {
5445 "bool": {
5446 "must": [
5447 {
5448 "nested": {
5449 "path": "coreKeyWord",
5450 "query": {
5451 "exists": {
5452 "field": "coreKeyWord.corekwd"
5453 }
5454 }
5455 }
5456 }
5457
5458 ]
5459 }
5460 }
5461 }
5462
5463 GET seojoindata/_search
5464 {
5465 "track_total_hits": true,
5466 "query": {
5467
5468 "nested": {
5469 "path": "coreKeyWord",
5470 "query": {
5471 "bool": {
5472 "must": [
5473 {
5474 "term": {
5475 "is_valid": {
5476 "value": 1
5477 }
5478 }
5479 },
5480 {
5481 "exists": {
5482 "field": "article_summery"
5483 }
5484 },
5485 {
5486 "exists": {
5487 "field": "coreKeyWord.corekwd"
5488 }
5489 }
5490 ]
5491 }
5492 }
5493 }
5494 }
5495 }
5496
5497 GET seojoindata/_search
5498 {
5499 "query": {
5500 "match_all": {}
5501 }
5502 }
5503
5504 GET seojoindata/_search
5505 {
5506 "size": 0,
5507 "query": {
5508 "bool": {
5509 "must": [
5510 {
5511 "term": {
5512 "is_valid": {
5513 "value": 1
5514 }
5515 }
5516 },
5517 {
5518 "match": {
5519 "taglist.tag": {
5520 "query": "",
5521 "minimum_should_match": "50%"
5522 }
5523 }
5524 }
5525 ]
5526 }
5527 },
5528 "aggs": {
5529 "group_by_tag_name": {
5530 "terms": {
5531 "field": "taglist.tag.raw",
5532 "size": 10
5533 },
5534 "aggs": {
5535 "group_by_tag_Id": {
5536 "terms": {
5537 "field": "taglist.tagId",
5538 "size": 1
5539 }
5540 }
5541 }
5542 }
5543 },
5544 "sort": [
5545 {
5546 "pubdate": {
5547 "order": "desc"
5548 }
5549 }
5550 ]
5551 }
5552
5553 GET seokeytagsdata/_search
5554 {
5555 "track_total_hits": true,
5556 "size": 0,
5557 "query": {
5558 "bool": {
5559 "must": [
5560 {
5561 "range": {
5562 "match_count": {
5563 "gte": 5
5564 }
5565 }
5566 },
5567 {
5568 "regexp": {
5569 "corekwd.raw": "a.*"
5570 }
5571 },
5572 {
5573 "term": {
5574 "keywords_type": {
5575 "value": 1
5576 }
5577 }
5578 }
5579 ]
5580 }
5581 },
5582 "aggs": {
5583 "group_by_click":{
5584 "top_hits": {
5585 "size": 10,
5586 "sort": [
5587 {
5588 "clickCount": {
5589 "order": "desc"
5590 }
5591 }
5592 ],
5593 "_source": {
5594 "includes": ["corekwdId","corekwd","clickCount"]
5595 }
5596 }
5597 }
5598 }
5599 }
5600
5601
5602 GET seokeytagsdata/_search
5603 {
5604 "track_total_hits": true,
5605 "size": 0,
5606 "query": {
5607 "bool": {
5608 "filter": {
5609 "prefix": {
5610 "corekwd.raw": "a"
5611 }
5612 },
5613 "must": [
5614 {
5615 "range": {
5616 "match_count": {
5617 "gte": 5
5618 }
5619 }
5620 },
5621 {
5622 "term": {
5623 "keywords_type": {
5624 "value": 0
5625 }
5626 }
5627 }
5628 ]
5629 }
5630 },
5631 "aggs": {
5632 "group_by_click":{
5633 "top_hits": {
5634 "size": 10,
5635 "sort": [
5636 {
5637 "clickCount": {
5638 "order": "desc"
5639 }
5640 }
5641 ]
5642 }
5643 }
5644 }
5645 }
5646
5647
5648 POST seojoindata/_update_by_query
5649 {
5650 "script": {
5651 "source": "ctx._source.seo_part_name='Medicines Company News';",
5652 "lang": "painless"
5653 },
5654 "query": {
5655 "term": {
5656 "seo_part_Id.keyword": {
5657 "value": "seoc11_1"
5658 }
5659 }
5660 }
5661 }
5662
5663 GET seojoindata/_search
5664 {
5665 "query": {
5666 "bool": {
5667 "filter": {
5668 "term": {
5669 "seo_part_Id.keyword": "seoc11_1"
5670 }
5671 },
5672 "must": [
5673 {
5674 "term": {
5675 "is_valid": {
5676 "value": 1
5677 }
5678 }
5679 },
5680 {
5681 "exists": {
5682 "field": "article_summery"
5683 }
5684 },
5685 {
5686 "exists": {
5687 "field": "taglist"
5688 }
5689 }
5690 ]
5691 }
5692 },
5693 "sort": [
5694 {
5695 "pubdate": {
5696 "order": "desc"
5697 }
5698 }
5699 ],
5700 "_source": {
5701 "excludes": [
5702 "article_en",
5703 "otherkwdlist",
5704 "title",
5705 "article_keys",
5706 "fullurl",
5707 "endSource",
5708 "originalKeyWord",
5709 "model",
5710 "coreKeyWord",
5711 "clickCount"
5712 ]
5713 }
5714 }
5715
5716 GET seojoindata/_search
5717 {
5718 "query": {
5719 "term": {
5720 "seo_part_Id.keyword": {
5721 "value": "seoc11_1"
5722 }
5723 }
5724 }
5725 }
5726
5727
5728 GET seojoindata/_search
5729 {
5730 "size": 0,
5731 "query": {
5732 "bool": {
5733 "must": [
5734 {
5735 "term": {
5736 "is_valid": {
5737 "value": 1
5738 }
5739 }
5740 },
5741 {
5742 "exists": {
5743 "field": "seo_part_Id"
5744 }
5745 }
5746 ]
5747 }
5748 },
5749 "aggs": {
5750 "group_by_part": {
5751 "terms": {
5752 "field": "seo_part_name.keyword",
5753 "size": 50
5754 },
5755 "aggs": {
5756 "group_by_part_Id": {
5757 "terms": {
5758 "field": "seo_part_Id.keyword",
5759 "size": 1
5760 }
5761 }
5762 }
5763 }
5764 }
5765 }
5766
5767 GET seojoindata/_search
5768 {
5769 "query": {
5770 "match_all": {}
5771 }
5772 }
5773
5774 GET seojoindata/_search
5775 {
5776 "track_total_hits": true,
5777 "query": {
5778 "bool": {
5779 "must": [
5780 {
5781 "term": {
5782 "is_valid": {
5783 "value": 1
5784 }
5785 }
5786 },
5787 {
5788 "exists": {
5789 "field": "article_summery"
5790 }
5791 },
5792 {
5793 "match": {
5794 "title_en": {
5795 "query": "salem zoom care",
5796 "minimum_should_match": "50%"
5797 }
5798 }
5799 }
5800 ]
5801 }
5802 },
5803 "_source": {
5804 "includes": [
5805 "articleId",
5806 "title_en",
5807 "clickCount",
5808 "article_summery",
5809 "pubdate"
5810 ]
5811 },
5812 "highlight": {
5813 "pre_tags": [
5814 "<span>"
5815 ],
5816 "post_tags": [
5817 "</span>"
5818 ],
5819 "fields": [{
5820 "title_en": {
5821 "type": "plain"
5822 }
5823 },
5824 {
5825 "article_en": {
5826 "type":"plain"
5827 }
5828 }
5829 ]
5830 }
5831 }
5832 GET /seokeytagsdata/_search
5833 {
5834 "query": {
5835 "bool": {
5836 "filter": {
5837 "term": {
5838 "keywords_type": 1
5839 }
5840 },
5841 "must": [
5842 {
5843 "terms": {
5844 "corekwdId": [
5845 131136,
5846 151308
5847 ]
5848 }
5849 }
5850 ]
5851 }
5852 },
5853 "_source": {
5854 "includes": [
5855 "corekwdId",
5856 "corekwd",
5857 "match_count"
5858 ]
5859 }
5860 }
5861
5862 GET /seokeytagsdata/_search
5863 {
5864 "size": 0,
5865 "query": {
5866 "bool": {
5867 "must": [
5868 {
5869 "range": {
5870 "match_count": {
5871 "gte": 5
5872 }
5873 }
5874 },
5875 {
5876 "term": {
5877 "keywords_type": {
5878 "value": 1
5879 }
5880 }
5881 },
5882 {
5883 "range": {
5884 "match_count": {
5885 "gte": 5
5886 }
5887 }
5888 }
5889 ]
5890 }
5891 },
5892 "aggs": {
5893 "group_by_click": {
5894 "top_hits": {
5895 "size": 10,
5896 "sort": [
5897 {
5898 "clickCount": {
5899 "order": "desc"
5900 }
5901 }
5902 ]
5903 }
5904 }
5905 }
5906 }
5907
5908
5909
5910 GET /seokeytagsdata/_search
5911 {
5912 "size": 7,
5913 "query": {
5914 "bool": {
5915 "must": [
5916 {
5917 "range": {
5918 "match_count": {
5919 "gte": 5
5920 }
5921 }
5922 },
5923 {
5924 "match": {
5925 "after_keytag": {
5926 "query": "3 inch polyiso insulation r value",
5927 "minimum_should_match": "60%"
5928 }
5929 }
5930 },
5931 {
5932 "term": {
5933 "keywords_type": {
5934 "value": 1
5935 }
5936 }
5937 }
5938 ],
5939 "must_not": [
5940 {
5941 "term": {
5942 "after_keytag.raw": {
5943 "value": "3 inch polyiso insulation r value"
5944 }
5945 }
5946 }
5947 ]
5948 }
5949 }
5950 }
5951
5952
5953 {
5954 "query": {
5955 "bool": {
5956 "must_not": [
5957 {
5958 "term": {
5959 "corekwd.raw": {
5960 "value": "VALUE"
5961 }
5962 }
5963 }
5964 ]
5965 }
5966 }
5967 }
5968
5969 GET seojoindata/_search
5970 POST seojoindata/_update_by_query
5971 {
5972 "script": {
5973 "source": "ctx._source.article_summery='''Paint knowledge how about Akzo Nobel Powder Coating Recommended introduction: powder coating is a kind of coating with different form from general coating, which is in powder form.''';ctx._source.article_en='''Paint knowledge how about Akzo Nobel Powder Coating Recommended introduction: powder coating is a kind of coating with different form from general coating, which is in powder form. <br/><br/>It is a new type of coating, because of its own advantages and more and more known by people. <br/><br/>Let's introduce Akzo Nobel Powder coating. <br/><br/>Akzo Nobel Powder coating is a cost-effective coating solution, which can be applied to different kinds of products. <br/><br/>After the treatment of static electricity and fire baking, a tough and durable coating surface will be formed, with the least impact on the environment. <br/><br/>Since the introduction of this technology, powder coating has been able to continue to maintain the coating "I want to see you" I want to see you "I want to see you" I want to see you "I want to see you''';",
5974 "lang": "painless"
5975 },
5976 "query": {
5977 "term": {
5978 "articleId": {
5979 "value": "5e573a51abe6408d7b0d5036"
5980 }
5981 }
5982 }
5983 }
5984
5985 {
5986 "size": 0,
5987 "query": {
5988 "bool": {
5989 "must": [
5990 {
5991 "term": {
5992 "is_valid": {
5993 "value": 1
5994 }
5995 }
5996 },
5997 {
5998 "term": {
5999 "seo_category_Id.keyword": {
6000 "value": "seoc14"
6001 }
6002 }
6003 },
6004 {
6005 "exists": {
6006 "field": "article_summery"
6007 }
6008 }
6009 ]
6010 }
6011 },
6012 "aggs": {
6013 "group_by_part_Id": {
6014 "terms": {
6015 "field": "seo_part_Id.keyword",
6016 "size": 30
6017 },
6018 "aggs": {
6019 "top_articles": {
6020 "top_hits": {
6021 "sort": [
6022 {
6023 "pubdate": {
6024 "order": "desc"
6025 }
6026 }
6027 ],
6028 "size": 10,
6029 "_source": {
6030 "includes": [
6031 "title_en",
6032 "articleId",
6033 "part_Id",
6034 "part_name",
6035 "category_type",
6036 "category_Id",
6037 "seo_part_Id",
6038 "seo_part_name",
6039 "seo_category_type",
6040 "seo_category_Id",
6041 "article_summery",
6042 "pubdate"
6043 ]
6044 }
6045 }
6046 }
6047 }
6048 }
6049 },
6050 "_source": {
6051 "excludes": [
6052 "article_en",
6053 "otherkwdlist",
6054 "taglist",
6055 "title",
6056 "article_keys",
6057 "fullurl",
6058 "endSource",
6059 "originalKeyWord",
6060 "coreKwdCount",
6061 "model",
6062 "clickCount"
6063 ]
6064 }
6065 }
6066
6067 GET /seojoindata/_search
6068 {
6069 "track_total_hits": true,
6070 "size": 10,
6071 "query": {
6072 "bool": {
6073 "filter": {
6074 "term": {
6075 "seo_part_Id.keyword": "seoc1113"
6076 }
6077 },
6078 "must": [
6079 {
6080 "term": {
6081 "is_valid": {
6082 "value": 1
6083 }
6084 }
6085 },
6086 {
6087 "exists": {
6088 "field": "article_summery"
6089 }
6090 },
6091 {
6092 "exists": {
6093 "field": "taglist"
6094 }
6095 }
6096 ]
6097 }
6098 },
6099 "sort": [
6100 {
6101 "pubdate": {
6102 "order": "desc"
6103 }
6104 }
6105 ],
6106 "_source": {
6107 "excludes": [
6108 "article_en",
6109 "otherkwdlist",
6110 "title",
6111 "article_keys",
6112 "fullurl",
6113 "endSource",
6114 "originalKeyWord",
6115 "model",
6116 "coreKeyWord",
6117 "clickCount"
6118 ]
6119 }
6120 }
6121
6122
6123 GET seokeytagsdata/_search
6124 {
6125 "size": 0,
6126 "query": {
6127 "bool": {
6128 "must": [
6129 {
6130 "range": {
6131 "match_count": {
6132 "gte": 5
6133 }
6134 }
6135 },
6136 {
6137 "term": {
6138 "keywords_type": {
6139 "value": 0
6140 }
6141 }
6142 }
6143 ]
6144 }
6145 },
6146 "aggs": {
6147 "group_by_click": {
6148 "top_hits": {
6149 "sort": [
6150 {
6151 "clickCount": {
6152 "order": "desc"
6153 }
6154 }
6155 ],
6156 "size": 15
6157 }
6158 }
6159 }
6160 }
6161
6162 GET seokeytagsdata/_search
6163 {
6164 "track_total_hits": true,
6165 "size": 10,
6166 "query": {
6167 "bool": {
6168 "must": [
6169 {
6170 "term": {
6171 "keywords_type": {
6172 "value": 0
6173 }
6174 }
6175 },
6176 {
6177 "exists": {
6178 "field": "key_title"
6179 }
6180 }
6181 ]
6182 }
6183 }
6184 }
6185
6186 POST seokeytagsdata/_update_by_query
6187 {
6188 "script": {
6189 "source": "ctx._source.clickCount=0;",
6190 "lang": "painless"
6191 },
6192 "query": {
6193 "bool": {
6194 "must": [
6195 {
6196 "term": {
6197 "corekwdId": {
6198 "value": 1933
6199 }
6200 }
6201 },
6202 {
6203 "term": {
6204 "keywords_type": {
6205 "value": 1
6206 }
6207 }
6208 }
6209 ]
6210 }
6211 }
6212 }
6213
6214 GET seokeytagsdata/_search
6215 {
6216 "size": 0,
6217 "query": {
6218 "constant_score": {
6219 "filter": {
6220 "range": {
6221 "keywords_type": {
6222 "gte": 0
6223 }
6224 }
6225 },
6226 "boost": 1.2
6227 }
6228 },
6229 "aggs": {
6230 "group_by_match_count": {
6231 "terms": {
6232 "field": "match_count",
6233 "size": 15
6234 },
6235 "aggs": {
6236 "top_match": {
6237 "top_hits": {
6238 "sort": [
6239 {
6240 "match_count": {
6241 "order": "desc"
6242 }
6243 }
6244 ],
6245 "size": 15
6246 }
6247 }
6248 }
6249 }
6250 }
6251 }
6252
6253
6254 {
6255 "query": {
6256 "bool": {
6257 "must": [
6258 {
6259 "term": {
6260 "corekwdId": {
6261 "value": 954773
6262 }
6263 }
6264 },
6265 {
6266 "term": {
6267 "keywords_type": {
6268 "value": 1
6269 }
6270 }
6271 }
6272 ]
6273 }
6274 }
6275 }
6276
6277
6278 GET seojoindata/_mapping/
6279
6280 GET seojoindata/_search
6281 {
6282 "size":1000,
6283 "query": {
6284 "match_all": {}
6285 },
6286 "sort": [
6287 {
6288 "pubdate": {
6289 "order": "desc"
6290 }
6291 }
6292 ],
6293 "_source": {
6294 "includes": ["pubdate"]
6295 }
6296 }
6297
6298
6299
6300
6301
6302
6303
6304 GET seojoindata/_search
6305 {
6306 "size": 0,
6307 "query": {
6308 "bool": {
6309 "must": [
6310 {
6311 "term": {
6312 "is_valid": {
6313 "value": 1
6314 }
6315 }
6316 },
6317 {
6318 "exists": {
6319 "field": "seo_part_Id"
6320 }
6321 }
6322 ]
6323 }
6324 },
6325 "aggs": {
6326 "group_by_part": {
6327 "terms": {
6328 "field": "seo_part_name.keyword",
6329 "size": 50
6330 },
6331 "aggs": {
6332 "group_by_part_Id": {
6333 "terms": {
6334 "field": "seo_part_Id.keyword",
6335 "size": 1
6336 }
6337 }
6338 }
6339 }
6340 }
6341 }
6342
6343
6344
6345 POST seojoindata/_update_by_query
6346 "script": {
6347 "source": "ctx._source.seo_part_Id='seoc2115_1';",
6348 "lang": "painless"
6349 },
6350 GET seojoindata/_search
6351 {
6352
6353 "query": {
6354 "bool": {
6355 "must": [
6356 {
6357 "term": {
6358 "seo_category_Id.keyword": {
6359 "value": "seoc21"
6360 }
6361 }
6362 },
6363 {
6364 "term": {
6365 "seo_part_name.keyword": {
6366 "value": "Anticaking Agent Knowledge"
6367 }
6368 }
6369 }
6370 ]
6371 }
6372 },
6373 "_source": {
6374 "includes": ["seo_category_Id","seo_part_Id","seo_part_name"]
6375 }
6376 }
6377
6378
6379 POST seojoindata/_update_by_query
6380 {
6381 "script": {
6382 "source": "ctx._source.clickCount=0;",
6383 "lang": "painless"
6384 },
6385 "query": {
6386 "bool": {
6387 "must": [
6388 {
6389 "term": {
6390 "seo": {
6391 "value": "5e5c97a2ba25c1e16609c6c8"
6392 }
6393 }
6394 }
6395 ]
6396 }
6397 }
6398 }
6399
6400
6401 GET seojoindata/_search
6402 {
6403 "track_total_hits": true,
6404 "query": {
6405 "term": {
6406 "seo_part_Id.keyword": {
6407 "value": "seoc11_2"
6408 }
6409 }
6410 }
6411 }
6412
6413 GET seojoindata/_search
6414 {
6415 "query": {
6416 "bool": {
6417 "must": [
6418 {
6419 "term": {
6420 "articleId": {
6421 "value": "5e5c97a2ba25c1e16609c6c8"
6422 }
6423 }
6424 }
6425 ]
6426 }
6427 },
6428 "_source": {
6429 "includes": ["articleId","clickCount","coreKeyWord","otherkwdlist"]
6430 }
6431 }
6432
6433 GET seojoindata/_search
6434 {
6435 "size": 10,
6436 "query": {
6437 "bool": {
6438 "must": [
6439 {
6440 "term": {
6441 "is_valid": {
6442 "value": 1
6443 }
6444 }
6445 },
6446 {
6447 "term": {
6448 "seo_category_Id.keyword": {
6449 "value": "seoc14"
6450 }
6451 }
6452 },
6453 {
6454 "exists": {
6455 "field": "article_en"
6456 }
6457 }
6458 ]
6459 }
6460 },
6461 "sort": [
6462 {
6463 "pubdate": {
6464 "order": "desc"
6465 }
6466 }
6467 ],
6468 "_source": {
6469 "excludes": [
6470 "article_en",
6471 "otherkwdlist",
6472 "taglist",
6473 "title",
6474 "article_keys",
6475 "fullurl",
6476 "endSource",
6477 "coreKeyWord",
6478 "originalKeyWord",
6479 "model",
6480 "part_Id",
6481 "part_name"
6482 ]
6483 }
6484 }
6485
6486 {
6487 "size": 0,
6488 "query": {
6489 "bool": {
6490 "must": [
6491 {
6492 "term": {
6493 "is_valid": {
6494 "value": 1
6495 }
6496 }
6497 },
6498 {
6499 "exists": {
6500 "field": "seo_part_Id"
6501 }
6502 }
6503 ]
6504 }
6505 },
6506 "aggs": {
6507 "group_by_part": {
6508 "terms": {
6509 "field": "seo_part_name.keyword",
6510 "size": 50
6511 },
6512 "aggs": {
6513 "group_by_part_Id": {
6514 "terms": {
6515 "field": "seo_part_Id.keyword",
6516 "size": 1
6517 }
6518 }
6519 }
6520 }
6521 }
6522 }
6523
6524
6525 {
6526 "track_total_hits": true,
6527 "size": 10,
6528 "query": {
6529 "bool": {
6530 "filter": {
6531 "term": {
6532 "seo_part_Id.keyword": "seoc1420"
6533 }
6534 },
6535 "must": [
6536 {
6537 "term": {
6538 "is_valid": {
6539 "value": 1
6540 }
6541 }
6542 },
6543 {
6544 "exists": {
6545 "field": "article_summery"
6546 }
6547 },
6548 {
6549 "exists": {
6550 "field": "taglist"
6551 }
6552 }
6553 ]
6554 }
6555 },
6556 "sort": [
6557 {
6558 "pubdate": {
6559 "order": "desc"
6560 }
6561 }
6562 ],
6563 "_source": {
6564 "excludes": [
6565 "article_en",
6566 "otherkwdlist",
6567 "title",
6568 "article_keys",
6569 "fullurl",
6570 "endSource",
6571 "originalKeyWord",
6572 "model",
6573 "coreKeyWord",
6574 "clickCount"
6575 ]
6576 }
6577 }
6578
6579
6580 {
6581 "size": 1,
6582 "query": {
6583 "bool": {
6584 "should": [
6585 {
6586 "term": {
6587 "seo_category_Id.keyword": {
6588 "value": "seoc1420"
6589 }
6590 }
6591 },
6592 {
6593 "term": {
6594 "seo_part_Id.keyword": {
6595 "value": "seoc1420"
6596 }
6597 }
6598 }
6599 ]
6600 }
6601 },
6602 "_source": {
6603 "includes": [
6604 "category_Id",
6605 "category_type",
6606 "part_Id",
6607 "part_name",
6608 "seo_category_Id",
6609 "seo_category_type",
6610 "seo_part_Id",
6611 "seo_part_name"
6612 ]
6613 }
6614 }
6615
6616 {
6617 "track_total_hits": true,
6618 "query": {
6619 "bool": {
6620 "must": [
6621 {
6622 "term": {
6623 "is_valid": {
6624 "value": 1
6625 }
6626 }
6627 },
6628 {
6629 "exists": {
6630 "field": "article_summery"
6631 }
6632 },
6633 {
6634 "match": {
6635 "title_en": {
6636 "query": "375 abi lane bath pa",
6637 "minimum_should_match": "35%"
6638 }
6639 }
6640 }
6641 ]
6642 }
6643 },
6644 "_source": {
6645 "includes": [
6646 "articleId",
6647 "title_en",
6648 "clickCount",
6649 "article_summery",
6650 "pubdate"
6651 ]
6652 },
6653 "highlight": {
6654 "pre_tags": [
6655 "<span>"
6656 ],
6657 "post_tags": [
6658 "</span>"
6659 ],
6660 "fields": {
6661 "title_en": {
6662 "type": "plain"
6663 }
6664 }
6665 }
6666 }
6667
6668
6669 GET seojoindata/_search
6670 {
6671 "size": 0,
6672 "query": {
6673 "bool": {
6674 "must": [
6675 {
6676 "term": {
6677 "is_valid": {
6678 "value": 1
6679 }
6680 }
6681 },
6682 {
6683 "term": {
6684 "seo_category_Id.keyword": {
6685 "value": "seoc14"
6686 }
6687 }
6688 },
6689 {
6690 "exists": {
6691 "field": "article_summery"
6692 }
6693 }
6694 ]
6695 }
6696 },
6697 "aggs": {
6698 "group_by_part_Id": {
6699 "terms": {
6700 "field": "seo_part_Id.keyword",
6701 "size": 30
6702 },
6703 "aggs": {
6704 "top_articles": {
6705 "top_hits": {
6706 "sort": [
6707 {
6708 "pubdate": {
6709 "order": "desc"
6710 }
6711 }
6712 ],
6713 "size": 10,
6714 "_source": {
6715 "includes": [
6716 "title_en",
6717 "articleId",
6718 "part_Id",
6719 "part_name",
6720 "category_type",
6721 "category_Id",
6722 "seo_part_Id",
6723 "seo_part_name",
6724 "seo_category_type",
6725 "seo_category_Id",
6726 "article_summery",
6727 "pubdate"
6728 ]
6729 }
6730 }
6731 }
6732 }
6733 }
6734 },
6735 "_source": {
6736 "excludes": [
6737 "article_en",
6738 "otherkwdlist",
6739 "taglist",
6740 "title",
6741 "article_keys",
6742 "fullurl",
6743 "endSource",
6744 "originalKeyWord",
6745 "coreKwdCount",
6746 "model",
6747 "clickCount"
6748 ]
6749 }
6750 }
6751
6752 {
6753 "track_total_hits": true,
6754 "query": {
6755 "bool": {
6756 "must": [
6757 {
6758 "term": {
6759 "endSource": {
6760 "value": "www.zyzhan.com"
6761 }
6762 }
6763 },
6764 {
6765 "term": {
6766 "model": {
6767 "value": "药机词典"
6768 }
6769 }
6770 }
6771 ]
6772 }
6773 },
6774 "_source": {
6775 "includes": ["category_Id","category_type","seo_category_Id","seo_category_type","seo_part_Id","endSource","model","seo_part_name"]
6776 }
6777 }
6778
6779 GET seojoindata/_search
6780 {
6781 "size": 10,
6782 "query": {
6783 "bool": {
6784 "must": [
6785 {
6786 "term": {
6787 "is_valid": {
6788 "value": 1
6789 }
6790 }
6791 },
6792 {
6793 "term": {
6794 "seo_category_Id.keyword": {
6795 "value": "seoc14"
6796 }
6797 }
6798 },
6799 {
6800 "exists": {
6801 "field": "article_en"
6802 }
6803 }
6804 ]
6805 }
6806 },
6807 "_source": {
6808 "excludes": [
6809 "article_en",
6810 "otherkwdlist",
6811 "taglist",
6812 "title",
6813 "article_keys",
6814 "fullurl",
6815 "endSource",
6816 "coreKeyWord",
6817 "originalKeyWord",
6818 "model",
6819 "part_Id",
6820 "part_name"
6821 ]
6822 }
6823 }
6824
6825
6826
6827 {
6828 "track_total_hits": true,
6829 "query": {
6830 "bool": {
6831 "filter": {
6832 "term": {
6833 "is_valid": {
6834 "value": 1
6835 }
6836 }
6837 }
6838 }
6839 },
6840 "aggs": {
6841 "group_by_category": {
6842 "terms": {
6843 "field": "seo_category_type.keyword",
6844 "size": 100
6845 }
6846 }
6847 }
6848 }
6849
6850
6851
6852 POST seojoindata/_update_by_query
6853 {
6854 "script": {
6855 "source": "ctx._source.seo_part_name='Feed Industry News';",
6856 "lang": "painless"
6857 },
6858 "query": {
6859 "bool": {
6860 "must": [
6861 {
6862 "term": {
6863 "endSource": {
6864 "value": "www.ew9z.com"
6865 }
6866 }
6867 },
6868 {
6869 "term": {
6870 "model": {
6871 "value": "禽蛋肉类"
6872 }
6873 }
6874 }
6875 ]
6876 }
6877 }
6878 }
6879
6880 {
6881 "size": 0,
6882 "query": {
6883 "bool": {
6884 "filter": {
6885 "term": {
6886 "is_valid": 1
6887 }
6888 }
6889 }
6890 },
6891 "aggs": {
6892 "group_by_category_type": {
6893 "terms": {
6894 "field": "seo_category_type.keyword",
6895 "size": 100
6896 },
6897 "aggs": {
6898 "show_category_Id": {
6899 "terms": {
6900 "field": "seo_category_Id.keyword",
6901 "size": 100
6902 },
6903 "aggs": {
6904 "group_by_part_name": {
6905 "terms": {
6906 "field": "seo_part_name.keyword",
6907 "size": 100
6908 },
6909 "aggs": {
6910 "show_part_Id": {
6911 "terms": {
6912 "field": "seo_part_Id.keyword",
6913 "size": 100
6914 }
6915 }
6916 }
6917 }
6918 }
6919 }
6920 }
6921 }
6922 }
6923 }
6924
6925
6926 DELETE seojoindata/_doc/0cc6e0c5-755d-11ea-a4b5-00cfe03abc06
6927
6928
6929
6930 GET seojoindata/_search
6931 {
6932 "track_total_hits": true,
6933 "query": {
6934 "bool": {
6935 "must": [
6936 {
6937 "term": {
6938 "articleId": {
6939 "value": "5e573a51abe6408d7b0d5036"
6940 }
6941 }
6942 }
6943 ]
6944 }
6945 }
6946 }
6947
6948 GET seojoindata/_search
6949 {
6950 "track_total_hits": true,
6951 "query": {
6952 "bool": {
6953 "must": [
6954 {
6955 "term": {
6956 "category_Id.keyword": {
6957 "value": "c15"
6958 }
6959 }
6960 }
6961 ]
6962 }
6963 },
6964 "_source": {
6965 "includes": ["articleId","article_en"]
6966 }
6967 }
6968
6969
6970 GET seojoindata/_search
6971 {
6972 "track_total_hits": true,
6973 "size": 400,
6974 "query": {
6975 "bool": {
6976 "must": [
6977 {
6978 "exists": {
6979 "field": "article_en"
6980 }
6981 },
6982 {
6983 "exists": {
6984 "field": "ar"
6985 }
6986 }
6987 ]
6988 }
6989 },
6990 "_source": {
6991 "includes": ["article_en"]
6992 }
6993 }
6994
6995 GET seojoindata/_search
6996 {
6997 "query": {
6998 "term": {
6999 "articleId": {
7000 "value": "5e7b37f064db6da8125687bb"
7001 }
7002 }
7003 }
7004 }
7005
7006
7007
7008 # DELETE seokeytagsdata
7009
7010 GET seokeytagsdata/_count
7011
7012
7013 GET seojoindata/_search
7014 {
7015 "track_total_hits": true,
7016 "query": {
7017 "regexp": {
7018 "pubdate": "201[0-9]{1}年.*"
7019 }
7020 },
7021 "_source": {
7022 "includes": ["pubdate","article_summery"]
7023 }
7024 }
7025
7026
7027 GET seojoindata/_search
7028 {
7029 "size": 0,
7030 "query": {
7031 "bool": {
7032 "filter": {
7033 "term": {
7034 "is_valid": 1
7035 }
7036 }
7037 }
7038 },
7039 "aggs": {
7040 "group_by_category": {
7041 "terms": {
7042 "field": "category_type",
7043 "size": 100
7044 },
7045 "aggs": {
7046 "group_by_category_Id": {
7047 "terms": {
7048 "field": "category_Id.keyword",
7049 "size": 1
7050 }
7051 }
7052 }
7053 }
7054 }
7055 }
7056
7057
7058 {
7059 "size": 0,
7060 "query": {
7061 "bool": {
7062 "must": [
7063 {
7064 "term": {
7065 "is_valid": {
7066 "value": 1
7067 }
7068 }
7069 },
7070 {
7071 "term": {
7072 "category_Id.keyword": {
7073 "value": "c14"
7074 }
7075 }
7076 },
7077 {
7078 "exists": {
7079 "field": "article_summery"
7080 }
7081 }
7082 ]
7083 }
7084 },
7085 "aggs": {
7086 "group_by_part_Id": {
7087 "terms": {
7088 "field": "part_Id",
7089 "size": 30
7090 },
7091 "aggs": {
7092 "top_articles": {
7093 "top_hits": {
7094 "sort": [
7095 {
7096 "pubdate": {
7097 "order": "desc"
7098 }
7099 }
7100 ],
7101 "size": 10,
7102 "_source": {
7103 "includes": [
7104 "title_en",
7105 "articleId",
7106 "part_Id",
7107 "part_name",
7108 "category_type",
7109 "category_Id",
7110 "article_summery",
7111 "pubdate"
7112 ]
7113 }
7114 }
7115 }
7116 }
7117 }
7118 },
7119 "_source": {
7120 "excludes": [
7121 "article_en",
7122 "otherkwdlist",
7123 "taglist",
7124 "title",
7125 "article_keys",
7126 "fullurl",
7127 "endSource",
7128 "originalKeyWord",
7129 "coreKwdCount",
7130 "model",
7131 "clickCount"
7132 ]
7133 }
7134 }
7135
7136
7137 {
7138 "size": 1,
7139 "query": {
7140 "bool": {
7141 "should": [
7142 {
7143 "term": {
7144 "category_Id.keyword": {
7145 "value": "c25"
7146 }
7147 }
7148 },
7149 {
7150 "term": {
7151 "part_Id": {
7152 "value": "c25"
7153 }
7154 }
7155 }
7156 ]
7157 }
7158 },
7159 "_source": {
7160 "includes": [
7161 "category_Id",
7162 "category_type",
7163 "part_Id",
7164 "part_name"
7165 ]
7166 }
7167 }
7168
7169
7170 {
7171 "size": 0,
7172 "query": {
7173 "bool": {
7174 "filter": {
7175 "term": {
7176 "is_valid": 1
7177 }
7178 }
7179 }
7180 },
7181 "aggs": {
7182 "group_by_category_type": {
7183 "terms": {
7184 "field": "category_type",
7185 "size": 100
7186 },
7187 "aggs": {
7188 "show_category_Id": {
7189 "terms": {
7190 "field": "category_Id.keyword",
7191 "size": 100
7192 },
7193 "aggs": {
7194 "group_by_part_name": {
7195 "terms": {
7196 "field": "part_name",
7197 "size": 100
7198 },
7199 "aggs": {
7200 "show_part_Id": {
7201 "terms": {
7202 "field": "part_Id",
7203 "size": 100
7204 }
7205 }
7206 }
7207 }
7208 }
7209 }
7210 }
7211 }
7212 }
7213 }
7214
7215
7216
7217 {
7218 "size": 0,
7219 "query": {
7220 "bool": {
7221 "must": [
7222 {
7223 "exists": {
7224 "field": "part_Id"
7225 }
7226 }
7227 ]
7228 }
7229 },
7230 "aggs": {
7231 "group_by_part": {
7232 "terms": {
7233 "field": "part_name",
7234 "size": 30
7235 },
7236 "aggs": {
7237 "group_by_part_Id": {
7238 "terms": {
7239 "field": "part_Id",
7240 "size": 1
7241 }
7242 }
7243 }
7244 }
7245 }
7246 }
7247
7248 GET seokeytagsdata/_search
7249 {
7250 "size": 0,
7251 "query": {
7252 "bool": {
7253 "must": [
7254 {
7255 "range": {
7256 "match_count": {
7257 "gte": 5
7258 }
7259 }
7260 },
7261 {
7262 "term": {
7263 "keywords_type": {
7264 "value": 0
7265 }
7266 }
7267 }
7268 ]
7269 }
7270 },
7271 "aggs": {
7272 "group_by_click": {
7273 "top_hits": {
7274 "sort": [
7275 {
7276 "clickCount": {
7277 "order": "desc"
7278 }
7279 }
7280 ],
7281 "size": 20
7282 }
7283 }
7284 }
7285 }
7286
7287
7288 {
7289 "size": 1,
7290 "query": {
7291 "bool": {
7292 "must": [
7293 {
7294 "range": {
7295 "match_count": {
7296 "gte": 5
7297 }
7298 }
7299 },
7300 {
7301 "term": {
7302 "keywords_type": {
7303 "value": 1
7304 }
7305 }
7306 },
7307 {
7308 "term": {
7309 "corekwdId": {
7310 "value": 996
7311 }
7312 }
7313 }
7314 ]
7315 }
7316 }
7317 }
7318
7319
7320 {
7321 "size": 10,
7322 "query": {
7323 "bool": {
7324 "must": [
7325 {
7326 "range": {
7327 "match_count": {
7328 "gte": 5
7329 }
7330 }
7331 },
7332 {
7333 "term": {
7334 "keywords_type": {
7335 "value": 0
7336 }
7337 }
7338 },
7339 {
7340 "match": {
7341 "corekwd": {
7342 "query": "1 2 benzenedithiol",
7343 "analyzer": "english",
7344 "minimum_should_match": "70%"
7345 }
7346 }
7347 }
7348 ]
7349 }
7350 }
7351 }
7352
7353
7354
7355
7356
7357
7358
7359
7360 {
7361 "size": 0,
7362 "query": {
7363 "bool": {
7364 "must": [
7365 {
7366 "term": {
7367 "keywords_type": {
7368 "value": 0
7369 }
7370 }
7371 },
7372 {
7373 "range": {
7374 "match_count": {
7375 "gte": 5
7376 }
7377 }
7378 }
7379 ]
7380 }
7381 },
7382 "aggs": {
7383 "group_by_click": {
7384 "top_hits": {
7385 "sort": [
7386 {
7387 "clickCount": {
7388 "order": "desc"
7389 }
7390 }
7391 ],
7392 "size": 10
7393 }
7394 }
7395 }
7396 }
7397
7398
7399 {
7400 "size": 0,
7401 "query": {
7402 "bool": {
7403 "must": [
7404 {
7405 "term": {
7406 "keywords_type": {
7407 "value": 1
7408 }
7409 }
7410 },
7411 {
7412 "range": {
7413 "match_count": {
7414 "gte": 5
7415 }
7416 }
7417 }
7418 ]
7419 }
7420 },
7421 "aggs": {
7422 "group_by_click": {
7423 "top_hits": {
7424 "size": 20,
7425 "sort": [
7426 {
7427 "clickCount": {
7428 "order": "desc"
7429 }
7430 }
7431 ]
7432 }
7433 }
7434 }
7435 }
7436
7437
7438 {
7439 "size": 0,
7440 "query": {
7441 "bool": {
7442 "must": [
7443 {
7444 "range": {
7445 "match_count": {
7446 "gte": 5
7447 }
7448 }
7449 }
7450 ]
7451 }
7452 },
7453 "aggs": {
7454 "group_by_click": {
7455 "top_hits": {
7456 "size": 10,
7457 "sort": [
7458 {
7459 "clickCount": {
7460 "order": "desc"
7461 }
7462 }
7463 ]
7464 }
7465 }
7466 }
7467 }
7468
7469
7470 {
7471 "track_total_hits": true,
7472 "query": {
7473 "match_all": {}
7474 }
7475 }
7476
7477
7478 GET seojoindata/_search
7479 {
7480 "track_total_hits": true,
7481 "size": 0,
7482 "query": {
7483 "bool": {
7484 "must": [
7485 {
7486 "match": {
7487 "title_en": {
7488 "query": "1 4 dichlorobenzene",
7489 "minimum_should_match": "30%"
7490 }
7491 }
7492 }
7493 ],
7494 "should": [
7495 {
7496 "match_phrase": {
7497 "title_en": {
7498 "query": "1 4 dichlorobenzene",
7499 "slop": 3
7500 }
7501 }
7502 },
7503 {
7504 "match": {
7505 "article_en": {
7506 "query": "1 4 dichlorobenzene",
7507 "minimum_should_match": "60%"
7508 }
7509 }
7510 },
7511 {
7512 "match_phrase": {
7513 "article_en": {
7514 "query": "1 4 dichlorobenzene",
7515 "slop": 3
7516 }
7517 }
7518 }
7519 ]
7520 }
7521 }
7522 }
7523
7524
7525
7526 {
7527 "size": 0,
7528 "query": {
7529 "bool": {
7530 "must": [
7531 {
7532 "term": {
7533 "category_Id.keyword": {
7534 "value": "c21"
7535 }
7536 }
7537 }
7538 ]
7539 }
7540 },
7541 "aggs": {
7542 "top_keyword": {
7543 "top_hits": {
7544 "sort": [
7545 {
7546 "coreKwdCount": {
7547 "order": "desc"
7548 }
7549 }
7550 ],
7551 "size": 15,
7552 "_source": {
7553 "includes": [
7554 "category_type",
7555 "category_Id",
7556 "pubdate",
7557 "coreKeyWord"
7558 ]
7559 }
7560 }
7561 }
7562 },
7563 "_source": {
7564 "excludes": [
7565 "article_en",
7566 "otherkwdlist",
7567 "taglist",
7568 "title",
7569 "article_keys",
7570 "fullurl",
7571 "endSource",
7572 "originalKeyWord",
7573 "model",
7574 "article_summery",
7575 "part_Id",
7576 "part_name",
7577 "title_en",
7578 "articleId",
7579 "category_type",
7580 "clickCount"
7581 ]
7582 }
7583 }
7584
7585
7586 {
7587 "size": 0,
7588 "query": {
7589 "bool": {
7590 "must": [
7591 {
7592 "term": {
7593 "category_Id.keyword": {
7594 "value": "c21"
7595 }
7596 }
7597 },
7598 {
7599 "exists": {
7600 "field": "article_summery"
7601 }
7602 }
7603 ]
7604 }
7605 },
7606 "aggs": {
7607 "group_by_part_Id": {
7608 "terms": {
7609 "field": "part_Id",
7610 "size": 100
7611 },
7612 "aggs": {
7613 "top_articles": {
7614 "top_hits": {
7615 "sort": [
7616 {
7617 "pubdate": {
7618 "order": "desc"
7619 }
7620 }
7621 ],
7622 "size": 10,
7623 "_source": {
7624 "includes": [
7625 "title_en",
7626 "articleId",
7627 "part_Id",
7628 "part_name",
7629 "category_type",
7630 "category_Id",
7631 "article_summery",
7632 "pubdate"
7633 ]
7634 }
7635 }
7636 }
7637 }
7638 }
7639 },
7640 "_source": {
7641 "excludes": [
7642 "article_en",
7643 "otherkwdlist",
7644 "taglist",
7645 "title",
7646 "article_keys",
7647 "fullurl",
7648 "endSource",
7649 "originalKeyWord",
7650 "coreKwdCount",
7651 "model",
7652 "clickCount"
7653 ]
7654 }
7655 }
7656
7657 {
7658 "size": 0,
7659 "aggs": {
7660 "group_by_category": {
7661 "terms": {
7662 "field": "category_type",
7663 "size": 100
7664 },
7665 "aggs": {
7666 "group_by_category_Id": {
7667 "terms": {
7668 "field": "category_Id.keyword",
7669 "size": 1
7670 }
7671 }
7672 }
7673 }
7674 }
7675 }
7676
7677 GET seokeytagsdata/_search
7678 {
7679 "track_total_hits": true,
7680 "size": 0,
7681 "query": {
7682 "bool": {
7683 "must": [
7684 {
7685 "term": {
7686 "keywords_type": {
7687 "value": 0
7688 }
7689 }
7690 },
7691 {
7692 "range": {
7693 "match_count": {
7694 "gte": 6
7695 }
7696 }
7697 }
7698 ]
7699 }
7700 },
7701 "aggs": {
7702 "top_click": {
7703 "top_hits": {
7704 "size": 20,
7705 "sort": [
7706 {
7707 "clickCount": {
7708 "order": "desc"
7709 }
7710 },
7711 {
7712 "match_count": {
7713 "order": "desc"
7714 }
7715 }
7716 ]
7717 }
7718 }
7719 }
7720 }
7721
7722 GET /seojoindata/_search
7723
7724
7725
7726
7727
7728 {
7729 "query": {
7730 "bool": {
7731 "must": [
7732 {
7733 "term": {
7734 "articleId": {
7735 "value": "5e572270abe6408d7b0d43cf"
7736 }
7737 }
7738 },
7739 {
7740 "term": {
7741 "is_valid": {
7742 "value": 1
7743 }
7744 }
7745 }
7746 ]
7747 }
7748 },
7749 "_source": {
7750 "excludes": [
7751 "otherkwdlist",
7752 "fullurl",
7753 "model",
7754 "title",
7755 "endSource"
7756 ]
7757 }
7758 }
7759
7760
7761 {
7762 "size": 0,
7763 "query": {
7764 "bool": {
7765 "filter": {
7766 "term": {
7767 "part_Id": "c2129"
7768 }
7769 },
7770 "must": [
7771 {
7772 "term": {
7773 "is_valid": {
7774 "value": 1
7775 }
7776 }
7777 }
7778 ]
7779 }
7780 },
7781 "aggs": {
7782 "group_by_tags": {
7783 "terms": {
7784 "field": "taglist.tag.raw",
7785 "size": 20
7786 },
7787 "aggs": {
7788 "group_by_tagId": {
7789 "terms": {
7790 "field": "taglist.tagId",
7791 "size": 1
7792 }
7793 }
7794 }
7795 }
7796 }
7797 }
7798
7799
7800
7801
7802
7803 GET /_cat/segments
7804
7805 DELETE /_search/scroll/_all
7806 {
7807 "aggs" : {
7808 "t_shirts" : {
7809 "filter" : { "term": { "type": "t-shirt" } },
7810 "aggs" : {
7811 "avg_price" : { "avg" : { "field" : "price" } }
7812 }
7813 }
7814 }
7815 }
7816
7817
7818 GET seojoindata/_search
7819 {
7820 "size": 0,
7821 "query": {
7822 "bool": {
7823 "filter": {
7824 "term": {
7825 "is_valid": 1
7826 }
7827 }
7828 }
7829 },
7830 "aggs": {
7831 "group_by_ct_type": {
7832 "terms": {
7833 "field": "category_Id.keyword",
7834 "size": 20
7835 },
7836 "aggs": {
7837 "group_by_part": {
7838 "terms": {
7839 "field": "part_name",
7840 "size": 30
7841 },
7842 "aggs": {
7843 "group_by_part_Id": {
7844 "terms": {
7845 "field": "part_Id",
7846 "size": 30
7847 }
7848 }
7849 }
7850 }
7851 }
7852 }
7853 }
7854 }
7855
7856
7857 GET seojoindata/_search
7858 {
7859 "size": 15,
7860 "query": {
7861 "bool": {
7862 "filter": {
7863 "term": {
7864 "is_valid": 1
7865 }
7866 }
7867 }
7868 },
7869 "sort": [
7870 {
7871 "clickCount": {
7872 "order": "desc"
7873 }
7874 }
7875 ],
7876 "_source": {
7877 "excludes": [
7878 "article_en",
7879 "otherkwdlist",
7880 "taglist",
7881 "title",
7882 "article_keys",
7883 "fullurl",
7884 "endSource",
7885 "coreKeyWord",
7886 "originalKeyWord",
7887 "model",
7888 "part_Id",
7889 "part_name"
7890 ]
7891 }
7892 }
7893
7894 GET seojoindata/_search
7895 {
7896 "size": 0,
7897 "query": {
7898 "bool": {
7899 "filter": {
7900 "term": {
7901 "is_valid": 1
7902 }
7903 }
7904 }
7905 },
7906 "aggs": {
7907 "group_by_category_type": {
7908 "terms": {
7909 "field": "category_type",
7910 "size": 100
7911 },
7912 "aggs": {
7913 "show_category_Id": {
7914 "terms": {
7915 "field": "category_Id.keyword",
7916 "size": 100
7917 },
7918 "aggs": {
7919 "group_by_part_name": {
7920 "terms": {
7921 "field": "part_name",
7922 "size": 100
7923 },
7924 "aggs": {
7925 "show_part_Id": {
7926 "terms": {
7927 "field": "part_Id",
7928 "size": 100
7929 }
7930 }
7931 }
7932 }
7933 }
7934 }
7935 }
7936 }
7937 }
7938 }
7939
7940 {
7941 "query": {
7942 "term": {
7943 "is_valid": {
7944 "value": 1
7945 }
7946 }
7947 }
7948 }
7949
7950 GET seojoindata/_search
7951 {
7952 "size": 10,
7953 "query": {
7954 "bool": {
7955 "filter": {
7956 "term": {
7957 "is_valid": 1
7958 }
7959 },
7960 "must": [
7961 {
7962 "term": {
7963 "category_Id.keyword": {
7964 "value": "c14"
7965 }
7966 }
7967 }
7968 ]
7969 }
7970 },
7971 "_source": {
7972 "includes": ["category_Id","category_type","part_Id","part_name"]
7973 }
7974 }
7975
7976 GET seojoindata/_search
7977 {
7978 "size": 10,
7979 "query": {
7980 "bool": {
7981 "must": [
7982 {
7983 "term": {
7984 "is_valid": {
7985 "value": 1
7986 }
7987 }
7988 },
7989 {
7990 "term": {
7991 "category_Id.keyword": {
7992 "value": "c11"
7993 }
7994 }
7995 }
7996 ]
7997 }
7998 },
7999 "_source": {
8000 "excludes": [
8001 "article_en",
8002 "otherkwdlist",
8003 "taglist",
8004 "title",
8005 "article_keys",
8006 "fullurl",
8007 "endSource",
8008 "coreKeyWord",
8009 "originalKeyWord",
8010 "model",
8011 "part_Id",
8012 "part_name"
8013 ]
8014 }
8015 }
8016
8017 GET seojoindata/_search
8018 {
8019 "track_total_hits": true,
8020 "size": 10,
8021 "query": {
8022 "bool": {
8023 "must": [
8024 {
8025 "exists": {
8026 "field": "taglist"
8027 }
8028 },
8029 {
8030 "term": {
8031 "is_valid": {
8032 "value": 1
8033 }
8034 }
8035 }
8036 ]
8037 }
8038 },
8039 "_source": {
8040 "includes": ["taglist","title_en"]
8041 }
8042 }
8043
8044
8045 GET seojoindata/_search
8046 {
8047 "size": 200,
8048 "query": {
8049 "bool": {
8050 "should": [
8051 {
8052 "match": {
8053 "title_en": {
8054 "query": "1.5 ml eppendorf tubes",
8055 "analyzer": "english",
8056 "minimum_should_match": "60%"
8057 }
8058 }
8059 },
8060 {
8061 "match_phrase": {
8062 "title_en": {
8063 "query": "1.5 ml eppendorf tubes",
8064 "analyzer": "english",
8065 "slop": 5
8066 }
8067 }
8068 },
8069 {
8070 "match_phrase": {
8071 "article_en": {
8072 "query": "1.5 ml eppendorf tubes",
8073 "analyzer": "english",
8074 "slop": 10
8075 }
8076 }
8077 },
8078 {
8079 "match": {
8080 "article_en": {
8081 "query": "1.5 ml eppendorf tubes",
8082 "analyzer": "english",
8083 "minimum_should_match": "60%"
8084 }
8085 }
8086 }
8087 ]
8088 }
8089 },
8090 "_source": {
8091 "excludes": ["article_en","otherkwdlist","coreKeyWord","fullurl","article_keys","article_summery","endSource","model","title",""]
8092 }
8093 }
8094
8095
8096 GET seokeytagsdata/_search
8097 {
8098 "track_total_hits": true,
8099 "size": 0,
8100 "query": {
8101 "bool": {
8102 "must": [
8103 {
8104 "range": {
8105 "match_count": {
8106 "gte": 5
8107 }
8108 }
8109 },
8110 {
8111 "regexp": {
8112 "corekwd.raw": "f.*"
8113 }
8114 },
8115 {
8116 "term": {
8117 "keywords_type": {
8118 "value": 1
8119 }
8120 }
8121 }
8122 ],
8123 "must_not": [
8124 {
8125 "term": {
8126 "after_keytag.raw": {
8127 "value": "fda organizational chart"
8128 }
8129 }
8130 }
8131 ]
8132 }
8133 },
8134 "aggs": {
8135 "group_by_click": {
8136 "top_hits": {
8137 "size": 10,
8138 "sort": [
8139 {
8140 "clickCount": {
8141 "order": "desc"
8142 }
8143 }
8144 ],
8145 "_source": {
8146 "includes": [
8147 "corekwdId",
8148 "corekwd",
8149 "match_count"
8150 ]
8151 }
8152 }
8153 }
8154 }
8155 }
8156
8157 GET seojoindata/_search
8158 {
8159 "query": {
8160 "bool": {
8161 "must": [
8162 {
8163 "term": {
8164 "taglist.tag_after.raw": {
8165 "value": "fda organizational chart"
8166 }
8167 }
8168 }
8169 ]
8170 }
8171 },
8172 "_source": {
8173 "includes": [
8174 "title_en",
8175 "articleId",
8176 "part_Id",
8177 "part_name",
8178 "category_type",
8179 "category_Id",
8180 "seo_part_Id",
8181 "seo_part_name",
8182 "seo_category_type",
8183 "seo_category_Id",
8184 "article_summery",
8185 "taglist",
8186 "pubdate",
8187 "clickCount"
8188 ]
8189 },
8190 "highlight": {
8191 "no_match_size": 180,
8192 "number_of_fragments": 3,
8193 "pre_tags": [
8194 "<span>"
8195 ],
8196 "post_tags": [
8197 "</span>"
8198 ],
8199 "fields": {
8200 "article_en": {
8201 "type": "plain"
8202 }
8203 }
8204 }
8205 }
8206
8207 GET /seojoindata/_search
8208 {
8209 "query": {
8210 "term": {
8211 "FIELD": {
8212 "value": "VALUE"
8213 }
8214 }
8215 },
8216 "highlight": {
8217 "no_match_size": 180,
8218 "number_of_fragments": 3,
8219 "pre_tags": [
8220 "<span>"
8221 ],
8222 "post_tags": [
8223 "</span>"
8224 ],
8225 "fields": {
8226 "article_en": {
8227 "type": "plain"
8228 }
8229 }
8230 }
8231 }
8232
8233
8234 # 关键词能够匹配上的文章数量
8235 GET /seojoindata/_search
8236 {
8237 "track_total_hits": true,
8238 "size": 0,
8239 "query": {
8240 "bool": {
8241 "must": [
8242 {
8243 "match": {
8244 "title_en": {
8245 "query": "0 dibromobenzene",
8246 "minimum_should_match": "60%"
8247 }
8248 }
8249 }
8250 ],
8251 "should": [
8252 {
8253 "match_phrase": {
8254 "title_en": {
8255 "query": "0 dibromobenzene",
8256 "slop": 3
8257 }
8258 }
8259 },
8260 {
8261 "match": {
8262 "article_en": {
8263 "query": "0 dibromobenzene",
8264 "minimum_should_match": "60%"
8265 }
8266 }
8267 },
8268 {
8269 "match_phrase": {
8270 "article_en": {
8271 "query": "0 dibromobenzene",
8272 "slop": 3
8273 }
8274 }
8275 }
8276 ]
8277 }
8278 }
8279 }
8280
8281
8282
8283 GET seojoindata/_search
8284 {
8285 "track_total_hits": true,
8286 "size": 0,
8287 "query": {
8288 "nested": {
8289 "path": "coreKeyWord",
8290 "query": {
8291 "term": {
8292 "coreKeyWord.corekwdId": {
8293 "value": "2057243"
8294 }
8295 }
8296 }
8297 }
8298 },
8299 "_source": {
8300 "includes": ["coreKeyWord","originalKeyWord"]
8301 }
8302 }
8303
8304
8305 # 统计每个核心词分配的文章数量
8306 GET seojoindata/_search
8307 {
8308 "size": 0,
8309 "aggs": {
8310 "group_by_kwId": {
8311 "nested": {
8312 "path": "coreKeyWord"
8313 },
8314 "aggs": {
8315 "group_by_kId": {
8316 "terms": {
8317 "field": "coreKeyWord.corekwdId",
8318 "size":6000
8319 }
8320 }
8321 }
8322 }
8323 }
8324 }
8325
8326
8327 GET seojoindata/_search
8328 {
8329 "track_total_hits": true,
8330 "size": 10,
8331 "query": {
8332 "nested": {
8333 "path": "coreKeyWord",
8334 "query": {
8335 "bool": {
8336 "must": [
8337 {
8338 "exists": {
8339 "field": "coreKeyWord.corekwd"
8340 }
8341 }
8342 ]
8343 }
8344 }
8345 }
8346 },
8347 "_source": {
8348 "excludes": [
8349 "article_en",
8350 "otherkwdlist"
8351 ]
8352 }
8353 }
8354
8355
8356 # rescore slop 移动的次数
8357 GET seojoindata/_search
8358 {
8359 "track_total_hits": true,
8360 "size": 10,
8361 "query": {
8362 "nested": {
8363 "path": "coreKeyWord",
8364 "query": {
8365 "bool": {
8366 "must": [
8367 {
8368 "exists": {
8369 "field": "coreKeyWord.corekwd"
8370 }
8371 }
8372 ]
8373 }
8374 }
8375 }
8376 },
8377 "rescore": {
8378 "query": {
8379 "rescore_query": {
8380 "match_phrase": {
8381 "originalKeyWord": {
8382 "query": "bakery shortening meaning",
8383 "slop": 20
8384 }
8385 }
8386 }
8387 },
8388 "window_size": 50
8389 },
8390 "_source": {
8391 "excludes": [
8392 "article_en",
8393 "otherkwdlist"
8394 ]
8395 }
8396 }
8397
8398 GET seojoindata/_search
8399 {
8400 "track_total_hits": true,
8401 "size": 25,
8402 "query": {
8403 "bool": {
8404 "should": [
8405 {
8406 "match_phrase": {
8407 "title_en": {
8408 "query": "citric acid dosage",
8409 "analyzer": "english"
8410 }
8411 }
8412 },
8413 {
8414 "match": {
8415 "title_en": {
8416 "query": "citric acid dosage",
8417 "minimum_should_match": "30%",
8418 "boost": 2,
8419 "analyzer": "english"
8420 }
8421 }
8422 },
8423 {
8424 "match_phrase": {
8425 "article_en": {
8426 "query": "citric acid dosage",
8427 "analyzer": "english"
8428 }
8429 }
8430 },
8431 {
8432 "match": {
8433 "article_en": {
8434 "query": "citric acid dosage",
8435 "minimum_should_match": "50%",
8436 "boost": 7,
8437 "analyzer": "english"
8438 }
8439 }
8440 }
8441 ]
8442 }
8443 },
8444 "_source": {
8445 "excludes": [
8446 "article_en"
8447 ]
8448 }
8449 }
8450
8451 GET seojoindata/_search
8452 {
8453 "track_total_hits": true,
8454 "size": 0,
8455 "query": {
8456 "bool": {
8457 "must": [
8458 {
8459 "exists": {
8460 "field": "originalKeyWord"
8461 }
8462 }
8463 ]
8464 }
8465 },
8466 "_source": {
8467 "excludes": [
8468 "endSource",
8469 "model",
8470 "category_Id",
8471 "category_type",
8472 "part_Id",
8473 "part_name",
8474 "article_summery",
8475 "is_valid"
8476 ]
8477 }
8478 }
8479
8480
8481 GET seojoindata/_search
8482 {
8483 "track_total_hits": true,
8484 "size": 0,
8485 "query": {
8486 "bool": {
8487 "must": [
8488 {
8489 "exists": {
8490 "field": "article_summery"
8491 }
8492 }
8493 ]
8494 }
8495 },
8496 "_source": {
8497 "includes": [
8498 "endSource",
8499 "model",
8500 "category_Id",
8501 "category_type",
8502 "part_Id",
8503 "part_name",
8504 "article_summery",
8505 "is_valid"
8506 ]
8507 }
8508 }
8509
8510 GET seojoindata/_search
8511 {
8512 "track_total_hits": true,
8513 "size": 10000,
8514 "query": {
8515 "bool": {
8516 "must": [
8517 {
8518 "term": {
8519 "endSource": {
8520 "value": "www.zyzhan.com"
8521 }
8522 }
8523 },
8524 {
8525 "term": {
8526 "part_name": {
8527 "value": "技术原理"
8528 }
8529 }
8530 }
8531 ],
8532 "must_not": [
8533 {
8534 "exists": {
8535 "field": "is_valid"
8536 }
8537 }
8538 ]
8539 }
8540 },
8541 "_source": {
8542 "includes": [
8543 "endSource",
8544 "model",
8545 "category_Id",
8546 "category_type",
8547 "part_Id",
8548 "part_name",
8549 "is_valid"
8550 ]
8551 }
8552 }
8553
8554 # 每个大类下的小类
8555 GET /seojoindata/_search
8556 {
8557 "size": 0,
8558 "query": {
8559 "bool": {
8560 "must": [
8561 {
8562 "term": {
8563 "is_valid": {
8564 "value": 1
8565 }
8566 }
8567 }
8568 ]
8569 }
8570 },
8571 "aggs": {
8572 "group_by_category": {
8573 "terms": {
8574 "field": "category_type",
8575 "size": 50
8576 },
8577 "aggs": {
8578 "group_by_part": {
8579 "terms": {
8580 "field": "part_name",
8581 "size": 20
8582 },
8583 "aggs": {
8584 "group_by_partId": {
8585 "terms": {
8586 "field": "part_Id",
8587 "size": 1
8588 }
8589 }
8590 }
8591 }
8592 }
8593 }
8594 }
8595 }
8596
8597
8598
8599 GET seokeytags_v4/_search
8600 {
8601 "query": {
8602 "term": {
8603 "articleId": {
8604 "value": "5e5f0102bdee44a1d6e79f2c"
8605 }
8606 }
8607 }
8608 }
8609
8610 GET /seokeytags_v4/_search
8611 {
8612 "query": {
8613 "term": {
8614 "endSource": {
8615 "value": "www.chembeango.com"
8616 }
8617 }
8618 },
8619 "aggs": {
8620 "filterAge": {
8621 "filter": {
8622
8623 }
8624 }
8625 },
8626 "_source": {
8627 "includes": [
8628 "category_Id",
8629 "category_type",
8630 "part_Id",
8631 "part_name"
8632 ]
8633 }
8634 }
8635
8636 # 查询关键词少于5篇的文章
8637
8638
8639
8640
8641
8642
8643 GET seojoindata/_search
8644 {
8645 "size": 0,
8646 "query": {
8647 "bool": {
8648 "must": [
8649 {
8650 "term": {
8651 "is_valid": {
8652 "value": 1
8653 }
8654 }
8655 },
8656 {
8657 "term": {
8658 "endSource": {
8659 "value": "www.bbaqw.com"
8660 }
8661 }
8662 }
8663 ]
8664 }
8665 },
8666 "aggs": {
8667 "group_by_part": {
8668 "terms": {
8669 "field": "part_name",
8670 "size": 30
8671 }
8672 }
8673 },
8674 "_source": {
8675 "includes": [
8676 "category_Id",
8677 "category_type",
8678 "part_Id",
8679 "part_name",
8680 "is_valid"
8681 ]
8682 }
8683 }
8684
8685
8686 GET /seokeytags_v4/_search
8687 {
8688 "track_total_hits": true,
8689 "query": {
8690 "term": {
8691 "endSource": {
8692 "value": "www.asiacoat.com"
8693 }
8694 }
8695 }
8696 }
8697
8698
8699 GET /keywordstag/_search
8700 {
8701 "query": {
8702 "term": {
8703 "corekwdId": {
8704 "value": 1666870
8705 }
8706 }
8707 }
8708 }
8709
8710 # 没有关键词的文章数量
8711 GET /seokeytags_v4/_search
8712 {
8713 "track_total_hits": true,
8714 "query": {
8715 "nested": {
8716 "path": "coreKeyWord",
8717 "query": {
8718 "bool": {
8719 "must": [
8720 {
8721 "exists": {
8722 "field": "coreKeyWord"
8723 }
8724 }
8725 ]
8726 }
8727 }
8728 }
8729 }
8730 }
8731
8732
8733 # 关键词深度分页
8734 GET /keywordstag/_search
8735 {
8736 "track_total_hits": true,
8737 "size": 100,
8738 "query": {
8739 "bool": {
8740 "must": [
8741 {
8742 "regexp": {
8743 "corekwd.raw": "a.*"
8744 }
8745 }
8746 ]
8747 }
8748 },
8749 "search_after":[60300],
8750 "sort": [
8751 {
8752 "corekwdId": {
8753 "order": "asc"
8754 }
8755 }
8756 ],
8757 "_source": {
8758 "includes": ["corekwdId","corekwd","keywords_type"]
8759 }
8760 }
8761
8762 # 获取关键词最大最小编号
8763
8764 GET /keywordstag/_search
8765 {
8766 "track_total_hits": true,
8767 "size": 0,
8768 "query": {
8769 "bool": {
8770 "must": [
8771 {
8772 "regexp": {
8773 "corekwd.raw": "b.*"
8774 }
8775 }
8776 ]
8777 }
8778 },
8779 "aggs": {
8780 "min_max_kId": {
8781 "stats": {
8782 "field": "corekwdId"
8783 }
8784 }
8785 }
8786 }
8787
8788
8789 GET /keywordstag/_search
8790 {
8791 "size": 10,
8792 "query": {
8793 "wildcard": {
8794 "corekwd.raw": {
8795 "value": "a.*"
8796 }
8797 }
8798 },
8799 "_source": {
8800 "includes": ["corekwdId","corekwd","keywords_type"]
8801 }
8802 }
8803
8804 GET /keywordstag/_search
8805 {
8806 "size": 10,
8807 "query": {
8808 "prefix": {
8809 "corekwd": {
8810 "value": "a"
8811 }
8812 }
8813 },
8814 "_source": {
8815 "includes": ["corekwdId","corekwd","keywords_type"]
8816 }
8817 }
8818
8819 GET /keywordstag/_search
8820 {
8821 "query": {
8822 "query_string": {
8823 "default_field": "corekwd",
8824 "query": {
8825 "prefix": {
8826 "corekwd": {
8827 "value": "a"
8828 }
8829 }
8830 }
8831 }
8832 }
8833 }
8834
8835 # 根据分类编号查询级别
8836 GET /seokeytags_v4/_search
8837 {
8838 "size": 1,
8839 "query": {
8840 "bool": {
8841 "should": [
8842 {
8843 "term": {
8844 "category_Id.keyword": {
8845 "value": "c14"
8846 }
8847 }
8848 },
8849 {
8850 "term": {
8851 "part_Id": {
8852 "value": "c14"
8853 }
8854 }
8855 }
8856 ]
8857 }
8858 },
8859 "_source": {
8860 "includes": ["category_Id","category_type","part_Id","part_name"]
8861 }
8862 }
8863
8864
8865 # 相关关键词
8866 GET /keywordstag/_search
8867 {
8868 "size": 20,
8869 "query": {
8870 "bool": {
8871 "must": [
8872 {
8873 "term": {
8874 "keywords_type": {
8875 "value": 0
8876 }
8877 }
8878 },
8879 {
8880 "match": {
8881 "corekwd": {
8882 "query": "opical antiviral drugs",
8883 "analyzer": "english",
8884 "minimum_should_match": "70%"
8885 }
8886 }
8887 }
8888 ]
8889 }
8890 }
8891 }
8892
8893 # 相关文章
8894 GET /seokeytags_v4/_search
8895 {
8896 "size":10,
8897 "query": {
8898 "bool": {
8899 "must": [
8900 {
8901 "match": {
8902 "title_en": {
8903 "query": "State Council announced national price linkage",
8904 "analyzer": "english",
8905 "minimum_should_match": "60%"
8906 }
8907 }
8908 }
8909 ]
8910 }
8911 },
8912 "_source": {
8913 "includes": ["articleId","title_en","pubdate","clickCount"]
8914 }
8915 }
8916
8917 # 文章点击量
8918 GET /seokeytags_v4/_search
8919 {
8920 "size": 0,
8921 "aggs": {
8922 "group_by_click": {
8923 "top_hits": {
8924 "size": 20,
8925 "sort": [
8926 {
8927 "clickCount": {
8928 "order": "desc"
8929 }
8930 }
8931 ],
8932 "_source": {
8933 "includes": [
8934 "articleId",
8935 "category_Id",
8936 "category_type",
8937 "title_en",
8938 "part_Id",
8939 "part_name",
8940 "pubdate",
8941 "clickCount"
8942 ]
8943 }
8944 }
8945 }
8946 }
8947 }
8948
8949 GET /keywordstag/_search
8950 {
8951 "query": {
8952 "term": {
8953 "keywords_type": {
8954 "value": 1
8955 }
8956 }
8957 }
8958 }
8959
8960 POST keywordstag/_update_by_query
8961 {
8962 "script": {
8963 "source": "ctx._source.clickCount=2;",
8964 "lang": "painless"
8965 },
8966 "query": {
8967 "bool": {
8968 "must": [
8969 {
8970 "term": {
8971 "corekwdId": {
8972 "value": 805
8973 }
8974 }
8975 }
8976 ]
8977 }
8978 }
8979 }
8980
8981 # 文章分配的关键词聚合
8982 GET /seokeytags_v4/_search
8983 {
8984 "size": 0,
8985 "aggs": {
8986 "group_by_tag_name": {
8987 "terms": {
8988 "field": "taglist.tag.raw",
8989 "size": 20
8990 },
8991 "aggs": {
8992 "group_by_tag_Id": {
8993 "terms": {
8994 "field": "taglist.tagId",
8995 "size": 1
8996 }
8997 }
8998 }
8999 }
9000 },
9001 "sort": [
9002 {
9003 "pubdate": {
9004 "order": "desc"
9005 }
9006 }
9007 ]
9008 }
9009
9010 # 按照tag点击次数聚合
9011 GET /keywordstag/_search
9012 {
9013 "size": 0,
9014 "query": {
9015 "term": {
9016 "keywords_type": {
9017 "value": 1
9018 }
9019 }
9020 },
9021 "aggs": {
9022 "group_by_click":{
9023 "top_hits": {
9024 "size": 20,
9025 "sort": [{
9026 "clickCount": {
9027 "order": "desc"
9028 }
9029 }]
9030 }
9031 }
9032 }
9033 }
9034
9035 GET /keywordstag/_search
9036 {
9037 "size": 0,
9038 "query": {
9039 "term": {
9040 "keywords_type": {
9041 "value": 1
9042 }
9043 }
9044 },
9045 "aggs": {
9046 "group_by_click": {
9047 "terms": {
9048 "field": "corekwd.raw",
9049 "size": 20
9050 },
9051 "aggs": {
9052 "group_by_Id": {
9053 "terms": {
9054 "field": "corekwdId",
9055 "size": 1
9056 }
9057 }
9058 }
9059 }
9060 },
9061 "sort": [
9062 {
9063 "clickCount": {
9064 "order": "desc"
9065 }
9066 }
9067 ]
9068 }
9069
9070
9071 # 文章详情页
9072 GET /seokeytags_v4/_search
9073 {
9074 "query": {
9075 "term": {
9076 "articleId": {
9077 "value": "5e5ca575ba25c1e16609cd88"
9078 }
9079 }
9080 },
9081 "_source": {
9082 "excludes": ["otherkwdlist","fullurl","model","title","endSource"]
9083 }
9084 }
9085
9086 # 根据关键词获取摘要
9087 GET /seokeytags_v4/_search
9088 {
9089 "query": {
9090 "bool": {
9091 "must": [
9092 {
9093 "match": {
9094 "article_en": {
9095 "query": "treatment",
9096 "minimum_should_match": "60%"
9097 }
9098 }
9099 },
9100 {
9101 "term": {
9102 "articleId": {
9103 "value": "5e4f9918d515cd7523346441"
9104 }
9105 }
9106 }
9107 ]
9108 }
9109 },
9110 "highlight": {
9111 "no_match_size": 150,
9112 "number_of_fragments":3,
9113 "pre_tags": [
9114 "<span>"
9115 ],
9116 "post_tags": [
9117 "</span>"
9118 ],
9119 "fields": {
9120 "article_en": {
9121 "type": "plain"
9122 }
9123 }
9124 },
9125 "_source": {
9126 "excludes": ["otherkwdlist","fullurl","model","title","endSource"]
9127 }
9128 }
9129
9130
9131 # Tag词列表页下的热点文章 desc
9132 GET /seokeytags_v4/_search
9133 {
9134 "size": 0,
9135 "query": {
9136 "bool": {
9137 "must": [
9138 {"exists": {
9139 "field": "article_summery"
9140 }},
9141 {
9142 "match": {
9143 "title_en": {
9144 "query": "ulpa filter",
9145 "minimum_should_match": "70%"
9146 }
9147 }
9148 }
9149 ]
9150 }
9151 },
9152 "aggs": {
9153 "group_by_clickCount": {
9154 "top_hits": {
9155 "sort": [
9156 {
9157 "clickCount": {
9158 "order": "desc"
9159 }
9160 }
9161 ],
9162 "size": 20,
9163 "_source": {
9164 "includes": [
9165 "title_en",
9166 "articleId",
9167 "part_Id",
9168 "part_name",
9169 "article_summery",
9170 "category_type",
9171 "category_Id",
9172 "pubdate",
9173 "clickCount"
9174 ]
9175 }
9176 }
9177 }
9178 }
9179 }
9180
9181
9182 # 点击量排名前20的关键词
9183 GET /keywordstag/_search
9184 {
9185 "size": 0,
9186 "query": {
9187 "term": {
9188 "keywords_type": {
9189 "value": 0
9190 }
9191 }
9192 },
9193 "aggs": {
9194 "group_by_click": {
9195 "top_hits": {
9196 "sort": [
9197 {
9198 "clickCount": {
9199 "order": "desc"
9200 }
9201 }
9202 ],
9203 "size": 20
9204 }
9205 }
9206 }
9207 }
9208
9209 GET /keywordstag/_search
9210 {
9211 "query": {
9212 "term": {
9213 "after_keytag.raw": {
9214 "value": "mg full form in medical"
9215 }
9216 }
9217 }
9218 }
9219
9220 # 根据tagId获取tag数据
9221 GET /keywordstag/_search
9222 {
9223 "query": {
9224 "bool": {
9225 "must": [
9226 {
9227 "term": {
9228 "keywords_type": {
9229 "value": 1
9230 }
9231 }
9232 },
9233 {
9234 "term": {
9235 "corekwdId": {
9236 "value": 805
9237 }
9238 }
9239 }
9240 ]
9241 }
9242 }
9243 }
9244
9245 # tags列表页 文章
9246 GET /seokeytags_v4/_search
9247 {
9248 "track_total_hits": true,
9249 "from": 0,
9250 "size": 20,
9251 "query": {
9252 "bool": {
9253 "must": [
9254 {
9255 "exists": {
9256 "field": "taglist"
9257 }
9258 },
9259 {
9260 "exists": {
9261 "field": "article_summery"
9262 }
9263 },
9264 {
9265 "term": {
9266 "taglist.tag.raw": {
9267 "value": "emtricitabine"
9268 }
9269 }
9270 }
9271 ]
9272 }
9273 },
9274 "_source": {
9275 "includes": [
9276 "title_en",
9277 "articleId",
9278 "part_Id",
9279 "part_name",
9280 "category_type",
9281 "category_Id",
9282 "article_summery",
9283 "taglist",
9284 "pubdate",
9285 "clickCount"
9286 ]
9287 }
9288 }
9289
9290
9291 GET /seokeytags_v4/_search
9292 {
9293 "query": {
9294 "bool": {
9295 "must": [
9296 {
9297 "exists": {
9298 "field": "taglist"
9299 }
9300 }
9301 ]
9302 }
9303 },
9304 "_source": {
9305 "includes": [
9306 "title_en",
9307 "articleId",
9308 "part_Id",
9309 "part_name",
9310 "category_type",
9311 "category_Id",
9312 "taglist",
9313 "pubdate",
9314 "clickCount"
9315 ]
9316 }
9317 }
9318
9319 # 关键词列表页 topics 按照二级分类文章数量desc 聚合
9320 GET /seokeytags_v4/_search
9321 {
9322 "size": 0,
9323 "query": {
9324 "bool": {
9325 "must": [
9326 {"exists": {
9327 "field": "part_Id"
9328 }}
9329 ]
9330 }
9331 },
9332 "aggs": {
9333 "group_by_part": {
9334 "terms": {
9335 "field": "part_name",
9336 "size": 10
9337 },
9338 "aggs": {
9339 "group_by_part_Id": {
9340 "terms": {
9341 "field": "part_Id",
9342 "size": 1
9343 }
9344 }
9345 }
9346 }
9347 }
9348 }
9349
9350 # 关键词类表页下的热点文章 desc
9351 GET /seokeytags_v4/_search
9352 {
9353 "size": 0,
9354 "query": {
9355 "bool": {
9356 "must": [
9357 {"exists": {
9358 "field": "article_summery"
9359 }},
9360 {
9361 "match": {
9362 "title_en": {
9363 "query": "ulpa filter",
9364 "analyzer": "english",
9365 "minimum_should_match": "70%"
9366 }
9367 }
9368 }
9369 ]
9370 }
9371 },
9372 "aggs": {
9373 "group_by_clickCount": {
9374 "top_hits": {
9375 "sort": [
9376 {
9377 "clickCount": {
9378 "order": "desc"
9379 }
9380 }
9381 ],
9382 "size": 20,
9383 "_source": {
9384 "includes": [
9385 "title_en",
9386 "articleId",
9387 "part_Id",
9388 "part_name",
9389 "category_type",
9390 "category_Id",
9391 "pubdate",
9392 "clickCount"
9393 ]
9394 }
9395 }
9396 }
9397 }
9398 }
9399
9400 # 关键词列表页 hottag 匹配tag词然后再聚合
9401 GET /seokeytags_v4/_search
9402 {
9403 "size": 0,
9404 "query": {
9405 "bool": {
9406 "must": [
9407 {
9408 "match": {
9409 "taglist.tag": {
9410 "query": "0.22 micron filter",
9411 "minimum_should_match": "40%"
9412
9413 }
9414 }
9415 }
9416 ]
9417 }
9418 },
9419 "aggs": {
9420 "group_by_tag_name": {
9421 "terms": {
9422 "field": "taglist.tag.raw",
9423 "size": 20
9424 },
9425 "aggs": {
9426 "group_by_tag_Id": {
9427 "terms": {
9428 "field": "taglist.tagId",
9429 "size": 1
9430 }
9431 }
9432 }
9433 }
9434 },
9435 "sort": [
9436 {
9437 "pubdate": {
9438 "order": "desc"
9439 }
9440 }
9441 ]
9442 }
9443
9444 # 相关tag词匹配
9445 GET keywordstag/_search
9446 {
9447 "size": 20,
9448 "query": {
9449 "bool": {
9450 "must": [
9451 {
9452 "match": {
9453 "corekwd":{
9454 "query": "bitterant",
9455 "minimum_should_match": "60%"
9456 }
9457 }
9458 },
9459 {
9460 "term": {
9461 "keywords_type": {
9462 "value": 1
9463 }
9464 }
9465 }
9466 ]
9467 }
9468 }
9469 }
9470
9471 # 相关关键词匹配
9472 GET keywordstag/_search
9473 {
9474 "size": 20,
9475 "query": {
9476 "bool": {
9477 "must": [
9478 {
9479 "match": {
9480 "corekwd":{
9481 "query": "0.1 glycine buffer",
9482 "minimum_should_match": "75%"
9483 }
9484 }
9485 },
9486 {
9487 "term": {
9488 "keywords_type": {
9489 "value": 0
9490 }
9491 }
9492 }
9493 ]
9494 }
9495 }
9496 }
9497
9498 GET keywordstag/_search
9499 {
9500 "query": {
9501 "term": {
9502 "corekwdId": {
9503 "value": 1309905
9504 }
9505 }
9506 }
9507 }
9508
9509
9510 GET /seokeytags_v4/_search
9511 {
9512 "query": {
9513 "match_all": {}
9514 }
9515 }
9516
9517
9518
9519
9520 # 根据关键词ID获取关键词信息
9521 GET seokeytags_v4/_search
9522 {
9523 "track_total_hits": true,
9524 "size": 20,
9525 "query": {
9526 "bool": {
9527 "should": [
9528 {"term": {
9529 "otherkwdlist.keyId": {
9530 "value": "1004333"
9531 }
9532 }},
9533 {
9534 "term": {
9535 "coreKeyWord.corekwdId": {
9536 "value": "1004333"
9537 }
9538 }
9539 }
9540 ]
9541 }
9542 }
9543
9544 }
9545
9546 # 相关关键词匹配title
9547 GET seokeytags_v4/_search
9548 {
9549 "track_total_hits": true,
9550 "from": 0,
9551 "size": 20,
9552 "query": {
9553 "bool": {
9554 "must": [
9555 {
9556 "exists": {
9557 "field": "article_summery"
9558 }
9559 },
9560 {
9561 "match": {
9562 "title_en": {
9563 "query": "0.05 edta solution preparation"
9564 }
9565 }
9566 }
9567 ]
9568 }
9569 },
9570 "_source": {
9571 "includes": [
9572 "articleId",
9573 "title_en",
9574 "clickCount",
9575 "article_summery",
9576 "pubdate"
9577 ]
9578 },
9579 "highlight": {
9580 "pre_tags": [
9581 "<span>"
9582 ],
9583 "post_tags": [
9584 "</span>"
9585 ],
9586 "fields": {
9587 "title_en": {
9588 "type": "plain"
9589 }
9590 }
9591 }
9592 }
9593
9594
9595 # 相关关键词文章内容
9596 GET seokeytags_v4/_search
9597 {
9598 "track_total_hits": true,
9599 "size": 20,
9600 "query": {
9601 "bool": {
9602 "must": [
9603 {
9604 "exists": {
9605 "field": "article_summery"
9606 }
9607 }
9608 ],
9609 "should": [
9610 {
9611 "match_phrase": {
9612 "title_en": {
9613 "query": "trichloro propanone",
9614 "analyzer": "english"
9615 }
9616 }
9617 },
9618 {
9619 "match": {
9620 "title_en": {
9621 "query": "trichloro propanone",
9622 "minimum_should_match": "50%",
9623 "boost": 5
9624 }
9625 }
9626 },
9627 {
9628 "match": {
9629 "article_summery": {
9630 "query": "trichloro propanone",
9631 "minimum_should_match": "70%",
9632 "boost": 5
9633 }
9634 }
9635 },
9636 {
9637 "match_phrase": {
9638 "article_en": {
9639 "query": "trichloro propanone",
9640 "analyzer": "english"
9641 }
9642 }
9643 },
9644 {
9645 "match": {
9646 "article_en": {
9647 "query": "trichloro propanone",
9648 "minimum_should_match": "70%",
9649 "boost": 7,
9650 "analyzer": "english"
9651 }
9652 }
9653 }
9654
9655 ]
9656 }
9657 },
9658 "_source": {
9659 "includes": [
9660 "articleId",
9661 "title_en",
9662 "clickCount",
9663 "article_summery",
9664 "pubdate"
9665 ]
9666 }
9667 }
9668
9669 GET /seokeytags_v4/_search
9670 {
9671 "track_total_hits": true,
9672 "query": {
9673 "nested": {
9674 "path": "coreKeyWord",
9675 "query": {
9676 "match": {
9677 "coreKeyWord.corekwd": {
9678 "query": "polarised state meaning",
9679 "minimum_should_match": "60%"
9680 }
9681 }
9682 }
9683 }
9684 },
9685 "_source": {
9686 "includes": [
9687 "part_Id",
9688 "coreKeyWord",
9689 "pubdate",
9690 "article_summery",
9691 "articleId",
9692 "title_en",
9693 "clickCount"
9694 ]
9695 }
9696 }
9697
9698 GET seokeytags_v4/_search
9699 {
9700 "track_total_hits": true,
9701 "size": 20,
9702 "query": {
9703 "nested": {
9704 "path": "coreKeyWord",
9705 "query": {
9706 "bool": {
9707 "must": [
9708 {
9709 "exists": {
9710 "field": "article_summery"
9711 }
9712 }
9713 ],
9714 "should": [
9715 {
9716 "term": {
9717 "coreKeyWord.corekwd": {
9718 "value": "polarised state meaning"
9719 }
9720 }
9721 },
9722 {
9723 "match_phrase": {
9724 "coreKeyWord.corekwd": {
9725 "query": "polarised state meaning"
9726 }
9727 }
9728 },
9729 {
9730 "match": {
9731 "coreKeyWord.corekwd": {
9732 "query": "polarised state meaning"
9733
9734 }
9735 }
9736 }
9737 ]
9738 }
9739 }
9740 }
9741 },
9742 "_source": {
9743 "includes": [
9744 "part_Id",
9745 "coreKeyWord",
9746 "pubdate",
9747 "article_summery",
9748 "articleId",
9749 "title_en",
9750 "clickCount"
9751 ]
9752 }
9753 }
9754
9755 # 二级分类页的大类导航
9756 GET /seokeytags_v4/_search
9757 {
9758 "size": 0,
9759 "aggs": {
9760 "group_by_category": {
9761 "terms": {
9762 "field": "category_type",
9763 "size": 100
9764 },
9765 "aggs": {
9766 "group_by_category_Id": {
9767 "terms": {
9768 "field": "category_Id.keyword",
9769 "size": 1
9770 }
9771 }
9772 }
9773 }
9774 }
9775 }
9776
9777
9778 # 二级分类页下的点击量前20的关键词
9779 GET /seokeytags_v4/_search
9780 {
9781 "size": 0,
9782 "query": {
9783 "bool": {
9784 "filter": {
9785 "term": {
9786 "part_Id": "c2113"
9787 }
9788 }
9789 }
9790 },
9791 "aggs": {
9792 "group_by_clickCount": {
9793 "top_hits": {
9794 "size": 20,
9795 "sort": [
9796 {
9797 "clickCount": {
9798 "order": "desc"
9799 }
9800 }
9801 ],
9802 "_source": {
9803 "includes": [
9804 "part_Id",
9805 "coreKeyWord",
9806 "pubdate",
9807 "clickCount"
9808 ]
9809 }
9810 }
9811 }
9812 }
9813 }
9814
9815 # 二级分类页下的点击量前20的文章
9816 GET /seokeytags_v4/_search
9817 {
9818 "size": 0,
9819 "query": {
9820 "bool": {
9821 "filter": {
9822 "term": {
9823 "part_Id": "c2113"
9824 }
9825 },
9826 "must": [
9827 {
9828 "exists": {
9829 "field": "article_summery"
9830 }
9831 }
9832 ]
9833 }
9834 },
9835 "aggs": {
9836 "top_articles": {
9837 "top_hits": {
9838 "size": 20,
9839 "sort": [
9840 {
9841 "clickCount": {
9842 "order": "desc"
9843 }
9844 }
9845 ],
9846 "_source": {
9847 "includes": [
9848 "title_en",
9849 "articleId",
9850 "part_Id",
9851 "part_name",
9852 "category_type",
9853 "category_Id",
9854 "pubdate",
9855 "clickCount"
9856 ]
9857 }
9858 }
9859 }
9860 }
9861 }
9862 # 二级分类页下的按照标签对应的文章数量desc top20标签
9863 GET /seokeytags_v4/_search
9864 {
9865 "size": 0,
9866 "query": {
9867 "bool": {
9868 "filter": {
9869 "term": {
9870 "part_Id": "c2113"
9871 }
9872 }
9873 }
9874 },
9875 "aggs": {
9876 "group_by_tags": {
9877 "terms": {
9878 "field": "taglist.tag.raw",
9879 "size": 20
9880 },
9881 "aggs": {
9882 "group_by_tagId": {
9883 "terms": {
9884 "field": "taglist.tagId",
9885 "size": 1
9886 }
9887 }
9888 }
9889 }
9890 }
9891 }
9892
9893
9894
9895 # 二级分类页
9896 GET /seokeytags_v4/_search
9897 {
9898 "track_total_hits": true,
9899 "from": 0,
9900 "size": 20,
9901 "query": {
9902 "bool": {
9903 "filter": {
9904 "term": {
9905 "part_Id": "c2113"
9906 }
9907 },
9908 "must": [
9909 {"exists": {
9910 "field": "article_summery"
9911 }},
9912 {
9913 "exists": {
9914 "field": "taglist"
9915 }
9916 }
9917 ]
9918 }
9919 },
9920 "sort": [
9921 {
9922 "pubdate": {
9923 "order": "desc"
9924 }
9925 }
9926 ],
9927 "_source": {
9928 "excludes": [
9929 "article_en",
9930 "otherkwdlist",
9931 "title",
9932 "article_keys",
9933 "fullurl",
9934 "endSource",
9935 "originalKeyWord",
9936 "model",
9937 "coreKeyWord",
9938 "clickCount"
9939 ]
9940 }
9941 }
9942
9943
9944 # 一级分类项下的top 20关键词
9945 GET /seokeytags_v4/_search
9946 {
9947 "size": 0,
9948 "query": {
9949 "bool": {
9950 "must": [
9951 {
9952 "term": {
9953 "category_Id.keyword": {
9954 "value": "c14"
9955 }
9956 }
9957 }
9958 ]
9959 }
9960 },
9961 "aggs": {
9962 "top_keyword": {
9963 "top_hits": {
9964 "sort": [
9965 {
9966 "coreKwdCount": {
9967 "order": "desc"
9968 }
9969 }
9970 ],
9971 "size": 20,
9972 "_source": {
9973 "includes": [
9974 "category_type",
9975 "category_Id",
9976 "pubdate",
9977 "coreKeyWord",
9978 "coreKwdCount"
9979 ]
9980 }
9981 }
9982 }
9983 },
9984 "_source": {
9985 "excludes": [
9986 "article_en",
9987 "otherkwdlist",
9988 "taglist",
9989 "title",
9990 "article_keys",
9991 "fullurl",
9992 "endSource",
9993 "originalKeyWord",
9994 "model",
9995 "article_summery",
9996 "part_Id",
9997 "part_name",
9998 "title_en",
9999 "articleId",
10000 "category_type",
10001 "clickCount"
10002 ]
10003 }
10004 }
10005
10006 # 一级分类下的热点文章 desc
10007 GET /seokeytags_v4/_search
10008 {
10009 "size": 0,
10010 "query": {
10011 "bool": {
10012 "must": [
10013 {
10014 "term": {
10015 "category_Id.keyword": {
10016 "value": "c21"
10017 }
10018 }
10019 },
10020 {
10021 "exists": {
10022 "field": "article_summery"
10023 }
10024 }
10025 ]
10026 }
10027 },
10028 "aggs": {
10029 "group_by_clickCount": {
10030 "top_hits": {
10031 "sort": [
10032 {
10033 "clickCount": {
10034 "order": "desc"
10035 }
10036 }
10037 ],
10038 "size": 20,
10039 "_source": {
10040 "includes": [
10041 "title_en",
10042 "articleId",
10043 "part_Id",
10044 "part_name",
10045 "category_type",
10046 "category_Id",
10047 "pubdate",
10048 "clickCount"
10049 ]
10050 }
10051 }
10052 }
10053 }
10054 }
10055
10056 # 一级分类名称下的标签聚合 排名前10的
10057 GET /seokeytags_v4/_search
10058 {
10059 "size": 0,
10060 "query": {
10061 "bool": {
10062 "must": [
10063 {
10064 "term": {
10065 "category_Id.keyword": {
10066 "value": "c21"
10067 }
10068 }
10069 }
10070 ]
10071 }
10072 },
10073 "aggs": {
10074 "group_by_tag_name": {
10075 "terms": {
10076 "field": "taglist.tag.raw",
10077 "size": 20
10078 },
10079 "aggs": {
10080 "group_by_tag_Id": {
10081 "terms": {
10082 "sort": [
10083 {
10084 "pubdate": {
10085 "order": "desc"
10086 }
10087 }
10088 ],
10089 "field": "taglist.tagId",
10090 "size": 1
10091 }
10092 }
10093 }
10094 }
10095 }
10096 }
10097
10098
10099 # 一级分类页和对应子类的文章
10100 GET /seokeytags_v4/_search
10101 {
10102 "size": 0,
10103 "query": {
10104 "bool": {
10105 "must": [
10106 {
10107 "term": {
10108 "category_Id.keyword": {
10109 "value": "c21"
10110 }
10111 }
10112 },
10113 {
10114 "exists": {
10115 "field": "article_summery"
10116 }
10117 }
10118 ]
10119 }
10120 },
10121 "aggs": {
10122 "group_by_part_Id": {
10123 "terms": {
10124 "field": "part_Id",
10125 "size": 20
10126 },
10127 "aggs": {
10128 "top_articles": {
10129 "top_hits": {
10130 "sort": [
10131 {
10132 "pubdate": {
10133 "order": "desc"
10134 }
10135 }
10136 ],
10137 "size": 20,
10138 "_source": {
10139 "includes": [
10140 "title_en",
10141 "articleId",
10142 "part_Id",
10143 "part_name",
10144 "category_type",
10145 "category_Id",
10146 "article_summery",
10147 "pubdate"
10148 ]
10149 }
10150 }
10151 }
10152 }
10153 }
10154 },
10155 "_source": {
10156 "excludes": [
10157 "article_en",
10158 "otherkwdlist",
10159 "taglist",
10160 "title",
10161 "article_keys",
10162 "fullurl",
10163 "endSource",
10164 "originalKeyWord",
10165 "coreKwdCount",
10166 "model",
10167 "clickCount"
10168 ]
10169 }
10170 }
10171
10172 # 点击量排名靠前的关键词 top 20
10173 GET /seokeytags_v4/_search
10174 {
10175 "size": 20,
10176 "query": {
10177 "match_all": {}
10178 },
10179 "sort": [
10180 {
10181 "coreKwdCount": {
10182 "order": "desc"
10183 }
10184 }
10185 ],
10186 "_source": {
10187 "excludes": [
10188 "article_en",
10189 "otherkwdlist",
10190 "taglist",
10191 "title",
10192 "article_keys",
10193 "fullurl",
10194 "endSource",
10195 "originalKeyWord",
10196 "model",
10197 "part_Id",
10198 "part_name",
10199 "title_en",
10200 "articleId",
10201 "category_type",
10202 "category_Id",
10203 "clickCount"
10204 ]
10205 }
10206 }
10207
10208
10209
10210 # hotArticals 按照文章点击量倒叙排序
10211 GET /seokeytags_v4/_search
10212 {
10213 "size": 20,
10214 "query": {
10215 "match_all": {}
10216 },
10217 "sort": [
10218 {
10219 "clickCount": {
10220 "order": "desc"
10221 }
10222 }
10223 ],
10224 "_source": {
10225 "excludes": [
10226 "article_en",
10227 "otherkwdlist",
10228 "taglist",
10229 "title",
10230 "article_keys",
10231 "fullurl",
10232 "endSource",
10233 "coreKeyWord",
10234 "originalKeyWord",
10235 "model",
10236 "part_Id",
10237 "part_name"
10238 ]
10239 }
10240 }
10241
10242
10243 # 获取每个大类对应的top15文章
10244 GET /seokeytags_v4/_search
10245 {
10246 "size": 20,
10247 "query": {
10248 "term": {
10249 "category_Id.keyword": {
10250 "value": "c15"
10251 }
10252 }
10253 },
10254 "_source": {
10255 "excludes": [
10256 "article_en",
10257 "otherkwdlist",
10258 "taglist",
10259 "title",
10260 "article_keys",
10261 "fullurl",
10262 "endSource",
10263 "coreKeyWord",
10264 "originalKeyWord",
10265 "model",
10266 "part_Id",
10267 "part_name"
10268 ]
10269 }
10270 }
10271
10272
10273 # 获取去重后的一级分类名称和Id
10274
10275 GET /seokeytags_v4/_search
10276 {
10277 "size": 0,
10278 "aggs": {
10279 "group_by_category_type": {
10280 "terms": {
10281 "field": "category_type"
10282 },
10283 "aggs": {
10284 "show_category_Id": {
10285 "terms": {
10286 "field": "category_Id.keyword"
10287 }
10288 }
10289 }
10290 }
10291 }
10292 }
10293
10294 GET /seokeytags_v4/_search
10295 {
10296 "size": 0,
10297 "aggs": {
10298 "group_by_category_type": {
10299 "terms": {
10300 "field": "category_type"
10301 },
10302 "aggs": {
10303 "show_category_Id": {
10304 "terms": {
10305 "field": "category_Id.keyword"
10306 },
10307 "aggs": {
10308 "group_by_part_name": {
10309 "terms": {
10310 "field": "part_name",
10311 "size": 200
10312 },
10313 "aggs": {
10314 "show_part_Id": {
10315 "terms": {
10316 "field": "part_Id",
10317 "size": 10
10318 }
10319 }
10320 }
10321 }
10322 }
10323 }
10324 }
10325 }
10326 }
10327 }
10328
10329
10330 # 二级分类聚合
10331 GET /seokeytags_v4/_search
10332 {
10333 "size": 0,
10334 "aggs": {
10335 "group_by_part_name": {
10336 "terms": {
10337 "field": "part_name",
10338 "size":100
10339 },
10340 "aggs": {
10341 "show_part_Id": {
10342 "terms": {
10343 "field": "part_Id"
10344 }
10345 }
10346 }
10347 }
10348 }
10349 }
10350
10351
10352
10353 GET /seokeytags_v4/_mapping
10354
10355
10356
10357 GET /seokeytags_v4/_count
10358 # 67505
10359 GET /seokeytags_v2/_count
10360
10361 GET /seokeytags_v2/_search
10362 {
10363 "track_total_hits": true,
10364 "query": {
10365 "bool": {
10366 "must": [
10367 {
10368 "term": {
10369 "endSource": {
10370 "value": "www.youjc.com"
10371 }
10372 }
10373 }
10374 ]
10375 }
10376 },
10377 "_source": {
10378 "excludes": [
10379 "article_en",
10380 "otherkwdlist",
10381 "taglist"
10382 ]
10383 }
10384 }
10385
10386 GET /seokeytags_v4/_search
10387 {
10388 "query": {
10389 "bool": {
10390 "must": [
10391 {
10392 "term": {
10393 "endSource": {
10394 "value": "Pharmaceutical Intermediates"
10395 }
10396 }
10397 },
10398 {
10399 "term": {
10400 "model": {
10401 "value": "药物疗效"
10402 }
10403 }
10404 }
10405 ]
10406 }
10407 },
10408 "_source": {
10409 "excludes": [
10410 "article_en",
10411 "otherkwdlist",
10412 "taglist"
10413 ]
10414 }
10415 }
10416
10417 # 批量修改文章点击数
10418 POST seokeytags_v4/_update_by_query
10419 {
10420 "script": {
10421 "source": "ctx._source.clickCount=0;",
10422 "lang": "painless"
10423 },
10424 "query": {
10425 "match_all":{}
10426 }
10427 }
10428
10429
10430 POST seokeytags_v4/_update_by_query
10431 {
10432 "script": {
10433 "source": "ctx._source.category_type='Industrial Coatings';ctx._source.category_Id='c25';ctx._source.part_name='nan';ctx._source.part_Id='nan';",
10434 "lang": "painless"
10435 },
10436 "query": {
10437 "bool": {
10438 "must": [
10439 {
10440 "term": {
10441 "endSource": {
10442 "value": "www.asiacoat.com"
10443 }
10444 }
10445 }
10446 ]
10447 }
10448 }
10449 }
10450
10451
10452
10453 GET /seokeytags_v2/_search
10454 {
10455 "query": {
10456 "term": {
10457 "articleId": {
10458 "value": "5e5498fed515cd75583c0571"
10459 }
10460 }
10461 },
10462 "_source": {
10463 "excludes": [
10464 "article_en","otherkwdlist","taglist"
10465 ]
10466 }
10467 }
10468
10469 GET /seokeytags_v4/_search
10470 {
10471 "query": {
10472 "match_all": {}
10473 },
10474 "_source": {
10475 "excludes": [
10476 "article_en","otherkwdlist","taglist"
10477 ]
10478 }
10479 }
10480
10481
10482 GET /seokeytags_v2/_search
10483 {
10484 "track_total_hits":true,
10485 "size": 100,
10486 "query": {
10487 "bool": {
10488 "filter": {
10489 "exists": {
10490 "field": "article_summery"
10491 }
10492 }
10493 }
10494 }
10495 }
10496
10497
10498 # 排名前20个的tag词聚合
10499 GET /seokeytags_v4/_search
10500 {
10501 "track_total_hits": true,
10502 "size": 0,
10503 "aggs": {
10504 "group_by_taglist_tag": {
10505 "terms": {
10506 "field": "taglist.tag.raw",
10507 "size": 20
10508 },
10509 "aggs": {
10510 "group_by_tag_Id": {
10511 "terms": {
10512 "field": "taglist.tagId",
10513 "size": 1
10514 }
10515 }
10516 }
10517 }
10518 }
10519 }
10520
10521
10522 # 每个tag词都分配了多少次
10523 GET /seokeytags_v4/_search
10524 {
10525 "track_total_hits": true,
10526 "size": 0,
10527 "aggs": {
10528 "group_by_taglist_tag": {
10529 "terms": {
10530 "field": "taglist.tag.raw",
10531 "size": 20
10532 }
10533 },
10534 "group_by_endSource": {
10535 "terms": {
10536 "field": "title_en.raw",
10537 "size": 20
10538 }
10539 }
10540 }
10541 }
10542
10543 GET /seokeytags_v2/_search
10544 {
10545 "query": {
10546 "term": {
10547 "title_en.raw": {
10548 "value": "A brief report on the international soybean market"
10549 }
10550 }
10551 }
10552 }
10553
10554 GET /seokeytags_v2/_search
10555 {
10556 "size": 0,
10557 "aggs": {
10558 "total_count": {
10559 "terms": {
10560 "field": "title_en.raw",
10561 "size": 10
10562 }
10563 }
10564 }
10565 }
10566
10567
10568 # 匹配taglist
10569
10570 GET /seokeytags_v2/_search
10571 {
10572 "track_total_hits": true,
10573 "size": 200,
10574 "query": {
10575 "bool": {
10576 "should": [
10577 {
10578 "term": {
10579 "taglist.tag.raw": {
10580 "value": "flavorant"
10581 }
10582 }
10583 },
10584 {
10585 "match_phrase": {
10586 "taglist.tag": "flavorant"
10587 }
10588 },
10589 {
10590 "match": {
10591 "taglist.tag": "flavorant"
10592 }
10593 }
10594 ]
10595 }
10596 },
10597 "highlight": {
10598 "pre_tags": [
10599 "<strong>"
10600 ],
10601 "post_tags": [
10602 "</strong>"
10603 ],
10604 "fields": [
10605 {
10606 "article_en": {
10607 "type": "plain"
10608 }
10609 },
10610 {
10611 "title_en": {
10612 "type": "plain"
10613 }
10614 }
10615 ]
10616 }
10617 }
10618
10619 GET /seokeytags_v2/_search
10620 {
10621 "track_total_hits": true,
10622 "query": {
10623 "bool": {
10624 "must": [
10625 {
10626 "exists": {
10627 "field": "taglist"
10628 }
10629 }
10630 ]
10631 }
10632 },
10633 "sort": [
10634 {
10635 "taglist.tagId": {
10636 "order": "desc"
10637 }
10638 }
10639 ],
10640 "_source": {
10641 "excludes": [
10642 "article_en","otherkwdlist"
10643 ]
10644 }
10645 }
10646
10647 # 67288
10648 GET seokeytags_v2/_search
10649 {
10650 "track_total_hits": true,
10651 "size": 200,
10652 "query": {
10653 "nested": {
10654 "path": "coreKeyWord",
10655 "query": {
10656 "bool": {
10657 "must": [
10658 {"exists": {"field": "coreKeyWord"
10659 }}
10660 ]
10661 }
10662 }
10663 }
10664 },
10665 "_source": ["title_en","coreKeyWord","otherkwdlist"]
10666 }
10667
10668
10669
10670
10671
10672 # 聚合分析案例 家电卖场案例背景
10673 # 以一个家电卖场中的电视销售数据为背景,对各种品牌 颜色的电视的销量和销售额 进行各种角度的分析
10674 PUT /tvs
10675 {
10676 "mappings": {
10677 "properties": {
10678 "price":{
10679 "type": "long"
10680 },
10681 "color":{
10682 "type": "keyword"
10683 },
10684 "brand":{
10685 "type": "keyword"
10686 },
10687 "sold_date":{
10688 "type": "date"
10689 }
10690 }
10691 }
10692 }
10693
10694 # 批量导入数据
10695 POST /tvs/_bulk
10696 {"index":{"_index":"tvs"}}
10697 {"price":1000,"color":"红色","brand":"长虹","sold_date":"2016-10-28"}
10698 {"index":{"_index":"tvs"}}
10699 {"price":2000,"color":"红色","brand":"长虹","sold_date":"2016-11-05"}
10700 {"index":{"_index":"tvs"}}
10701 {"price":3000,"color":"绿色","brand":"小米","sold_date":"2016-05-18"}
10702 {"index":{"_index":"tvs"}}
10703 {"price":1500,"color":"蓝色","brand":"TCL","sold_date":"2016-07-02"}
10704 {"index":{"_index":"tvs"}}
10705 {"price":1200,"color":"绿色","brand":"TCL","sold_date":"2016-08-19"}
10706 {"index":{"_index":"tvs"}}
10707 {"price":2000,"color":"红色","brand":"长虹","sold_date":"2016-11-05"}
10708 {"index":{"_index":"tvs"}}
10709 {"price":8000,"color":"红色","brand":"三星","sold_date":"2017-01-01"}
10710 {"index":{"_index":"tvs"}}
10711 {"price":2500,"color":"蓝色","brand":"小米","sold_date":"2017-02-12"}
10712
10713 # 统计哪种颜色的电视销量最高
10714 # agg 固定语法 要对一份数据执行分组聚合操作
10715 # popular_color 就是对每个agg 都要起一个名字 名字可以自定义
10716 # terms 根据字段的值进行分组
10717 # field 根据指定的字段的值进行分组
10718 GET /tvs/_search
10719 {
10720 "size": 0,
10721 "aggs": {
10722 "popular_color": {
10723 "terms": {
10724 "field": "color"
10725 }
10726 }
10727 }
10728 }
10729
10730 # 嵌套agg metric聚合分析buket
10731 # 对颜色聚合后再计算每种颜色的平均价
10732 GET /tvs/_search
10733 {
10734 "size": 0,
10735 "aggs": {
10736 "group_by_color": {
10737 "terms": {
10738 "field": "color"
10739 },
10740 "aggs": {
10741 "avg_price": {
10742 "avg": {
10743 "field": "price"
10744 }
10745 }
10746 }
10747 }
10748 }
10749 }
10750
10751 # 从颜色到品牌商进行下钻分析
10752 # 每种颜色的平均价格 以及找到的每种颜色每个品牌的平均价格 我们可以进行多层次的下钻 比如说 现在有红的电视4台 同时这4台电视中有3台属于长虹 1台属于小米
10753 # 红色电视中的3台长虹的平均价是多少
10754 # 红色电视中的1台小米的平均价是多少
10755
10756 # 下钻的意思是 已经分了一个组,比如说颜色的分组,然后还要继续对这个分组内的数据再分组,比如一个颜色内,还可以分成多个不同的品牌的组,最后对每个最小粒度的分组执行聚合分析操作,这就叫下钻分析
10757 GET /tvs/_search
10758 {
10759 "size": 0,
10760 "aggs": {
10761 "group_by_color": {
10762 "terms": {
10763 "field": "color"
10764 },
10765 "aggs": {
10766 "color_avg_price": {
10767 "avg": {
10768 "field": "price"
10769 }
10770 },
10771 "group_by_brand":{
10772 "terms": {
10773 "field": "brand"
10774 },
10775 "aggs": {
10776 "brand_avg_price": {
10777 "avg": {
10778 "field": "price"
10779 }
10780 }
10781 }
10782 }
10783 }
10784 }
10785 }
10786 }
10787
10788 # 更多的metric
10789 # count avg
10790 # count bucket terms 自动会有一个doc_count 相当于count
10791
10792 GET /tvs/_search
10793 {
10794 "size": 0,
10795 "aggs": {
10796 "group_by_color": {
10797 "terms": {
10798 "field": "color"
10799 },
10800 "aggs": {
10801 "avg_price": {
10802 "avg": {
10803 "field": "price"
10804 }
10805 },
10806 "max_price":{
10807 "max": {
10808 "field": "price"
10809 }
10810 },
10811 "min_price":{
10812 "min": {
10813 "field": "price"
10814 }
10815 },
10816 "sum_price":{
10817 "sum": {
10818 "field": "price"
10819 }
10820 }
10821 }
10822 }
10823 }
10824 }
10825
10826
10827 # histogram 类似terms 也是进行bucket分组操作,接收一个field 按照这个field的值个各个范围区间进行bucket分组操作
10828 # "histogram":{"filed":"price","interval":2000}
10829 # interval:2000 划分范围 0-2000 2000-4000 4000-6000,。。。。。 buckets
10830 GET /tvs/_search
10831 {
10832 "size": 0,
10833 "aggs": {
10834 "group_by_price": {
10835 "histogram": {
10836 "field": "price",
10837 "interval": 2000
10838 },
10839 "aggs": {
10840 "sum_price": {
10841 "sum": {
10842 "field": "price"
10843 }
10844 }
10845 }
10846 }
10847 }
10848 }
10849
10850 # date_histogram 按照指定的某个date类型的日期field 以及interval
10851 # min_doc_count 即使某个日期的Interval 一条数据没有,那么这个区间也是返回的
10852 # extended_bounds min max 划分bucket的时候会限定在一个具体的范围之内
10853 # 按照月份划分
10854 GET /tvs/_search
10855 {
10856 "size": 0,
10857 "aggs": {
10858 "group_by_sold_date": {
10859 "date_histogram": {
10860 "field": "sold_date",
10861 "interval": "month",
10862 "format": "yyyy-MM-dd",
10863 "min_doc_count": 0,
10864 "extended_bounds": {
10865 "min": "2016-01-01",
10866 "max": "2017-01-31"
10867 }
10868 }
10869 }
10870 }
10871 }
10872
10873
10874
10875
10876 # 每个季度每个品牌的销售额
10877 GET /tvs/_search
10878 {
10879 "size": 0,
10880 "aggs": {
10881 "group_by_sold_date": {
10882 "date_histogram": {
10883 "field": "sold_date",
10884 "interval": "quarter",
10885 "min_doc_count": 0,
10886 "extended_bounds": {
10887 "min": "2016-01-01",
10888 "max": "2017-12-31"
10889 }
10890 },
10891 "aggs": {
10892 "group_by_brand": {
10893 "terms": {
10894 "field": "brand"
10895 },
10896 "aggs": {
10897 "sum_price": {
10898 "sum": {
10899 "field": "price"
10900 }
10901 }
10902 }
10903 },
10904 "total_sum_price":{
10905 "sum": {
10906 "field": "price"
10907 }
10908 }
10909 }
10910 },
10911 "toal_brand_sum_price":{
10912 "sum": {
10913 "field": "price"
10914 }
10915 }
10916 }
10917 }
10918
10919 # 查询nested coreKeyWord
10920 GET seokeytags_v2/_search
10921 {
10922 "track_total_hits": true,
10923 "query": {
10924 "nested": {
10925 "path": "coreKeyWord",
10926 "query": {
10927 "bool": {
10928 "should": [
10929 {"term": {
10930 "coreKeyWord.corekwd": {
10931 "value": "citric acid uses cosmetics"
10932 }
10933 }},
10934 {
10935 "match_phrase": {
10936 "coreKeyWord.corekwd": {
10937 "query": "citric acid uses cosmetics"
10938 }
10939 }
10940 },
10941 {
10942 "match": {
10943 "coreKeyWord.corekwd": {
10944 "query": "citric acid uses cosmetics",
10945 "minimum_should_match":"50%"
10946 }
10947 }
10948 }
10949 ]
10950 }
10951 }
10952 }
10953 }
10954 }
10955
10956
10957
10958 # 查询含有中文的核心词
10959 GET seokeytags_v2/_search
10960 {
10961 "track_total_hits": true,
10962 "query": {
10963 "nested": {
10964 "path": "coreKeyWord",
10965 "query": {
10966 "bool": {
10967 "should": [
10968 {
10969 "term": {
10970 "coreKeyWord.corekwd": {
10971 "value": "中文"
10972 }
10973 }
10974 },
10975 {
10976 "match_phrase": {
10977 "coreKeyWord.corekwd": {
10978 "query": "中文"
10979 }
10980 }
10981 },
10982 {
10983 "match": {
10984 "coreKeyWord.corekwd": {
10985 "query": "中文",
10986 "minimum_should_match": "50%"
10987 }
10988 }
10989 }
10990 ]
10991 }
10992 }
10993 }
10994 },
10995 "_source": {
10996 "excludes": [
10997 "article_en"
10998 ]
10999 }
11000 }
11001
11002
11003
11004 GET seokeytags/_search
11005 {
11006 "track_total_hits": true,
11007 "size": 200,
11008 "query": {
11009 "nested": {
11010 "path": "coreKeyWord",
11011 "query": {
11012 "bool": {
11013 "must": [
11014 {
11015 "exists": {
11016 "field": "coreKeyWord"
11017 }
11018 }
11019 ]
11020 }
11021 }
11022 }
11023 },
11024 "_source": ["title_en","coreKeyWord","otherkwdlist","taglist"]
11025 }
11026
11027
11028 GET seokeytags/_search
11029 {
11030 "track_total_hits": true,
11031 "size": 200,
11032 "query": {
11033 "bool": {
11034 "must_not": [
11035 {"exists": {
11036 "field": "originalKeyWord"
11037 }}
11038 ]
11039 }
11040 },
11041 "_source": ["title_en","coreKeyWord","otherkwdlist"]
11042 }
11043
11044 # 去重
11045
11046 GET seokeytags/_search
11047 {
11048 "track_total_hits": true,
11049 "size": 0,
11050 "aggs": {
11051 "distict_title": {
11052 "cardinality": {
11053 "field": "fullurl"
11054 }
11055 }
11056 }
11057 }
11058
11059
11060 GET seokeytags/_search
11061 {
11062 "query": {
11063 "match_all": {}
11064 }
11065 }
11066
11067
11068
11069 GET /seokeytags/_mapping
11070
11071 GET /_cat/health
11072
11073 GET /seokeytags_v2/_count
11074
11075 GET /seokeytags/_count
11076
11077 PUT seokeytags_v3
11078 {
11079 "mappings": {
11080 "properties": {
11081 "articleId":{
11082 "type":"keyword"
11083 },
11084 "title": {
11085 "type": "text"
11086 },
11087 "title_en": {
11088 "type": "text",
11089 "fields": {
11090 "raw": {
11091 "type": "keyword"
11092 }
11093 },
11094 "analyzer": "english"
11095 },
11096 "article_en": {
11097 "type": "text",
11098 "analyzer": "english"
11099 },
11100 "article_keys": {
11101 "type": "text",
11102 "fields": {
11103 "raw": {
11104 "type": "keyword"
11105 }
11106 }
11107 },
11108 "article_summery": {
11109 "type": "text",
11110 "fields": {
11111 "raw": {
11112 "type": "keyword"
11113 }
11114 }
11115 },
11116 "clickCount": {
11117 "type": "long"
11118 },
11119 "originalKeyWord": {
11120 "type": "text",
11121 "analyzer": "english"
11122 },
11123 "coreKeyWord": {
11124 "type": "nested",
11125 "properties": {
11126 "corekwd":{
11127 "type":"text",
11128 "analyzer": "english"
11129 },
11130 "corekwdId":{
11131 "type":"long"
11132 }
11133 }
11134 },
11135 "otherkwdlist":{
11136 "type": "nested",
11137 "properties": {
11138 "keyname":{
11139 "type":"text",
11140 "analyzer": "english"
11141 },
11142 "keyId":{
11143 "type":"long"
11144 }
11145 }
11146 },
11147 "endSource": {
11148 "type": "keyword"
11149 },
11150 "fullurl": {
11151 "type": "keyword"
11152 },
11153 "model": {
11154 "type": "keyword"
11155 },
11156 "part_name": {
11157 "type": "keyword"
11158 },
11159 "part_type": {
11160 "type": "keyword"
11161 },
11162 "relatedKeyWords": {
11163 "type": "nested",
11164 "properties": {
11165 "rtdkwd": {
11166 "type": "text",
11167 "analyzer": "english"
11168 },
11169 "rtdkwdId":{
11170 "type":"long"
11171 }
11172 }
11173 },
11174 "relatedTags": {
11175 "type": "nested",
11176 "properties": {
11177 "tag": {
11178 "type": "keyword"
11179 },
11180 "tagId":{
11181 "type":"long"
11182 }
11183 }
11184 },
11185 "taglist": {
11186 "properties": {
11187 "tag": {
11188 "type": "text",
11189 "fields": {
11190 "raw": {
11191 "type": "keyword"
11192 }
11193 }
11194 },
11195 "tagId":{
11196 "type":"long"
11197 }
11198 }
11199 },
11200 "category_type": {
11201 "type": "keyword"
11202 }
11203 }
11204 }
11205 }
11206
11207 # DELETE seokeytagsdata
11208
11209 # 带文章匹配数的关键词模型 0408
11210 PUT seokeytagsdata
11211 {
11212 "mappings": {
11213 "properties": {
11214 "corekwd": {
11215 "type": "text",
11216 "analyzer": "english",
11217 "fields": {
11218 "raw": {
11219 "type": "keyword"
11220 }
11221 }
11222 },
11223 "corekwdId": {
11224 "type": "long"
11225 },
11226 "keywords_type": {
11227 "type": "long"
11228 },
11229 "clickCount":{
11230 "type": "long"
11231 },
11232 "del_flag":{
11233 "type": "long"
11234 },
11235 "match_count":{
11236 "type": "long"
11237 },
11238 "after_keytag": {
11239 "type": "text",
11240 "analyzer": "english",
11241 "fields": {
11242 "raw": {
11243 "type": "keyword"
11244 }
11245 }
11246 }
11247 }
11248 }
11249 }
11250
11251
11252 # 关键词名称 编号 类型 处理后名称
11253 PUT keywordstag
11254 {
11255 "mappings": {
11256 "properties": {
11257 "corekwd": {
11258 "type": "text",
11259 "analyzer": "english",
11260 "fields": {
11261 "raw": {
11262 "type": "keyword"
11263 }
11264 }
11265 },
11266 "corekwdId": {
11267 "type": "long"
11268 },
11269 "keywords_type": {
11270 "type": "long"
11271 },
11272 "clickCount":{
11273 "type": "long"
11274 },
11275 "after_keytag": {
11276 "type": "text",
11277 "analyzer": "english",
11278 "fields": {
11279 "raw": {
11280 "type": "keyword"
11281 }
11282 }
11283 }
11284 }
11285 }
11286 }
11287
11288 DELETE seojoindata
11289
11290 # 带编号和发布日期的模型
11291 # PUT seokeytags_v4
11292
11293 PUT seojoindata
11294 {
11295 "mappings": {
11296 "properties": {
11297 "articleId":{
11298 "type":"keyword"
11299 },
11300 "pubdate":{
11301 "type": "keyword"
11302 },
11303 "title": {
11304 "type": "text"
11305 },
11306 "title_en": {
11307 "type": "text",
11308 "fields": {
11309 "raw": {
11310 "type": "keyword"
11311 }
11312 },
11313 "analyzer": "english"
11314 },
11315 "article_hot_flag":{
11316 "type": "long"
11317 },
11318 "article_en": {
11319 "type": "text",
11320 "analyzer": "english"
11321 },
11322 "article_keys": {
11323 "type": "text",
11324 "fields": {
11325 "raw": {
11326 "type": "keyword"
11327 }
11328 }
11329 },
11330 "article_summery": {
11331 "type": "text",
11332 "fields": {
11333 "raw": {
11334 "type": "keyword"
11335 }
11336 }
11337 },
11338 "clickCount": {
11339 "type": "long"
11340 },
11341 "originalKeyWord": {
11342 "type": "text",
11343 "analyzer": "english"
11344 },
11345 "coreKwdCount":{
11346 "type": "long"
11347 },
11348 "coreKeyWord": {
11349 "type": "nested",
11350 "properties": {
11351 "corekwd":{
11352 "type":"text",
11353 "analyzer": "english"
11354 },
11355 "corekwdId":{
11356 "type":"long"
11357 }
11358 }
11359 },
11360 "otherkwdlist":{
11361 "type": "nested",
11362 "properties": {
11363 "keyname":{
11364 "type":"text",
11365 "analyzer": "english"
11366 },
11367 "keyId":{
11368 "type":"long"
11369 }
11370 }
11371 },
11372 "endSource": {
11373 "type": "keyword"
11374 },
11375 "fullurl": {
11376 "type": "keyword"
11377 },
11378 "model": {
11379 "type": "keyword"
11380 },
11381 "part_name": {
11382 "type": "keyword"
11383 },
11384 "part_Id": {
11385 "type": "keyword"
11386 },
11387 "part_type": {
11388 "type": "keyword"
11389 },
11390 "relatedKeyWords": {
11391 "type": "nested",
11392 "properties": {
11393 "rtdkwd": {
11394 "type": "text",
11395 "analyzer": "english"
11396 },
11397 "rtdkwdId":{
11398 "type":"long"
11399 }
11400 }
11401 },
11402 "relatedTags": {
11403 "type": "nested",
11404 "properties": {
11405 "tag": {
11406 "type": "keyword"
11407 },
11408 "tagId":{
11409 "type":"long"
11410 }
11411 }
11412 },
11413 "taglist": {
11414 "properties": {
11415 "tag": {
11416 "type": "text",
11417 "fields": {
11418 "raw": {
11419 "type": "keyword"
11420 }
11421 }
11422 },
11423 "tagId":{
11424 "type":"long"
11425 }
11426 }
11427 },
11428 "category_type": {
11429 "type": "keyword"
11430 },
11431 "category_Id ":{
11432 "type": "text"
11433 },
11434 "is_valid":{
11435 "type": "long"
11436 },
11437 "del_flag":{
11438 "type":"long"
11439 }
11440 }
11441 }
11442 }
11443
11444 # 创建一个备份索引 添加了未清洗前的词 tag词
11445 PUT seojoindata_back/
11446
11447 PUT seojoindata
11448 {
11449 "mappings": {
11450 "properties": {
11451 "articleId": {
11452 "type": "keyword"
11453 },
11454 "article_en": {
11455 "type": "text",
11456 "analyzer": "english"
11457 },
11458 "article_hot_flag": {
11459 "type": "long"
11460 },
11461 "article_keys": {
11462 "type": "text",
11463 "fields": {
11464 "raw": {
11465 "type": "keyword"
11466 }
11467 }
11468 },
11469 "article_summery": {
11470 "type": "text",
11471 "fields": {
11472 "raw": {
11473 "type": "keyword"
11474 }
11475 }
11476 },
11477 "category_Id": {
11478 "type": "text",
11479 "fields": {
11480 "keyword": {
11481 "type": "keyword",
11482 "ignore_above": 256
11483 }
11484 }
11485 },
11486 "category_type": {
11487 "type": "keyword"
11488 },
11489 "clickCount": {
11490 "type": "long"
11491 },
11492 "coreKeyWord": {
11493 "type": "nested",
11494 "properties": {
11495 "corekwd": {
11496 "type": "text",
11497 "analyzer": "english"
11498 },
11499 "corekwd_after": {
11500 "type": "text",
11501 "fields": {
11502 "raw": {
11503 "type": "keyword",
11504 "ignore_above": 256
11505 }
11506 },
11507 "analyzer": "english"
11508 },
11509 "corekwdId": {
11510 "type": "long"
11511 }
11512 }
11513 },
11514 "coreKwdCount": {
11515 "type": "long"
11516 },
11517 "del_flag": {
11518 "type": "long"
11519 },
11520 "endSource": {
11521 "type": "keyword"
11522 },
11523 "fullurl": {
11524 "type": "keyword"
11525 },
11526 "is_valid": {
11527 "type": "long"
11528 },
11529 "model": {
11530 "type": "keyword"
11531 },
11532 "originalKeyWord": {
11533 "type": "text",
11534 "analyzer": "english"
11535 },
11536 "otherkwdlist": {
11537 "type": "nested",
11538 "properties": {
11539 "keyId": {
11540 "type": "long"
11541 },
11542 "keyname_after": {
11543 "type": "text",
11544 "analyzer": "english",
11545 "fields": {
11546 "raw": {
11547 "type": "keyword",
11548 "ignore_above": 256
11549 }
11550 }
11551 },
11552 "keyname": {
11553 "type": "text",
11554 "analyzer": "english"
11555 }
11556 }
11557 },
11558 "part_Id": {
11559 "type": "keyword"
11560 },
11561 "part_name": {
11562 "type": "keyword"
11563 },
11564 "part_type": {
11565 "type": "keyword"
11566 },
11567 "pubdate": {
11568 "type": "keyword"
11569 },
11570 "relatedKeyWords": {
11571 "type": "nested",
11572 "properties": {
11573 "rtdkwd": {
11574 "type": "text",
11575 "analyzer": "english"
11576 },
11577 "rtdkwd_after": {
11578 "type": "text",
11579 "fields": {
11580 "raw": {
11581 "type": "keyword",
11582 "ignore_above": 256
11583 }
11584 },
11585 "analyzer": "english"
11586 },
11587 "rtdkwdId": {
11588 "type": "long"
11589 }
11590 }
11591 },
11592 "relatedTags": {
11593 "type": "nested",
11594 "properties": {
11595 "tag": {
11596 "type": "keyword"
11597 },
11598 "tag_after": {
11599 "type": "text",
11600 "fields": {
11601 "raw": {
11602 "type": "keyword",
11603 "ignore_above": 256
11604 }
11605 },
11606 "analyzer": "english"
11607 },
11608 "tagId": {
11609 "type": "long"
11610 }
11611 }
11612 },
11613 "seo_category_Id": {
11614 "type": "text",
11615 "fields": {
11616 "keyword": {
11617 "type": "keyword",
11618 "ignore_above": 256
11619 }
11620 }
11621 },
11622 "seo_category_type": {
11623 "type": "text",
11624 "fields": {
11625 "keyword": {
11626 "type": "keyword",
11627 "ignore_above": 256
11628 }
11629 }
11630 },
11631 "seo_part_Id": {
11632 "type": "text",
11633 "fields": {
11634 "keyword": {
11635 "type": "keyword",
11636 "ignore_above": 256
11637 }
11638 }
11639 },
11640 "seo_part_name": {
11641 "type": "text",
11642 "fields": {
11643 "keyword": {
11644 "type": "keyword",
11645 "ignore_above": 256
11646 }
11647 }
11648 },
11649 "taglist": {
11650 "properties": {
11651 "tag": {
11652 "type": "text",
11653 "fields": {
11654 "raw": {
11655 "type": "keyword"
11656 }
11657 }
11658 },
11659 "tag_after": {
11660 "type": "text",
11661 "fields": {
11662 "raw": {
11663 "type": "keyword",
11664 "ignore_above": 256
11665 }
11666 }
11667 },
11668 "tagId": {
11669 "type": "long"
11670 }
11671 }
11672 },
11673 "title": {
11674 "type": "text"
11675 },
11676 "title_en": {
11677 "type": "text",
11678 "fields": {
11679 "raw": {
11680 "type": "keyword"
11681 }
11682 },
11683 "analyzer": "english"
11684 }
11685 }
11686 }
11687 }