Advertisement
Guest User

Untitled

a guest
Oct 12th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.55 KB | None | 0 0
  1. {
  2. "size": 0,
  3. "query": {
  4. "bool": {
  5. "filter": [
  6. {
  7. "bool": {
  8. "should": [
  9. {
  10. "has_child": {
  11. "query": {
  12. "bool": {
  13. "filter": [
  14. {
  15. "bool": {
  16. "should": [
  17. {
  18. "match_phrase": {
  19. "GoogleSearch.keyword": {
  20. "query": "facebook",
  21. "slop": 0,
  22. "boost": 1
  23. }
  24. }
  25. }
  26. ],
  27. "adjust_pure_negative": true,
  28. "boost": 1
  29. }
  30. }
  31. ],
  32. "adjust_pure_negative": true,
  33. "boost": 1
  34. }
  35. },
  36. "type": "action",
  37. "score_mode": "none",
  38. "min_children": 0,
  39. "max_children": 2147483647,
  40. "ignore_unmapped": false,
  41. "boost": 1
  42. }
  43. },
  44. {
  45. "has_child": {
  46. "query": {
  47. "bool": {
  48. "filter": [
  49. {
  50. "bool": {
  51. "should": [
  52. {
  53. "match_phrase": {
  54. "AmazonOnSiteSearch.keyword": {
  55. "query": "hand spinner",
  56. "slop": 0,
  57. "boost": 1
  58. }
  59. }
  60. }
  61. ],
  62. "adjust_pure_negative": true,
  63. "boost": 1
  64. }
  65. }
  66. ],
  67. "adjust_pure_negative": true,
  68. "boost": 1
  69. }
  70. },
  71. "type": "action",
  72. "score_mode": "none",
  73. "min_children": 0,
  74. "max_children": 2147483647,
  75. "ignore_unmapped": false,
  76. "boost": 1
  77. }
  78. }
  79. ]
  80. }
  81. },
  82. {
  83. "bool": {
  84. "should": [
  85. {
  86. "has_child": {
  87. "query": {
  88. "bool": {
  89. "filter": [
  90. {
  91. "bool": {
  92. "should": [
  93. {
  94. "match_phrase": {
  95. "GoogleSearch.keyword": {
  96. "query": "youtube",
  97. "slop": 0,
  98. "boost": 1
  99. }
  100. }
  101. }
  102. ],
  103. "adjust_pure_negative": true,
  104. "boost": 1
  105. }
  106. }
  107. ],
  108. "adjust_pure_negative": true,
  109. "boost": 1
  110. }
  111. },
  112. "type": "action",
  113. "score_mode": "none",
  114. "min_children": 0,
  115. "max_children": 2147483647,
  116. "ignore_unmapped": false,
  117. "boost": 1
  118. }
  119. },
  120. {
  121. "has_child": {
  122. "query": {
  123. "bool": {
  124. "filter": [
  125. {
  126. "bool": {
  127. "should": [
  128. {
  129. "match_phrase": {
  130. "AmazonOnSiteSearch.keyword": {
  131. "query": "spinner",
  132. "slop": 0,
  133. "boost": 1
  134. }
  135. }
  136. }
  137. ],
  138. "adjust_pure_negative": true,
  139. "boost": 1
  140. }
  141. }
  142. ],
  143. "adjust_pure_negative": true,
  144. "boost": 1
  145. }
  146. },
  147. "type": "action",
  148. "score_mode": "none",
  149. "min_children": 0,
  150. "max_children": 2147483647,
  151. "ignore_unmapped": false,
  152. "boost": 1
  153. }
  154. }
  155. ],
  156. "adjust_pure_negative": true,
  157. "boost": 1
  158. }
  159. }
  160. ],
  161. "adjust_pure_negative": true,
  162. "boost": 1
  163. }
  164. },
  165. "aggregations": {
  166. "group_by": {
  167. "terms": {
  168. "field": "uuid",
  169. "size":100000
  170. },
  171. "aggs": {
  172. "children": {
  173. "children": {
  174. "type": "action"
  175. },
  176. "aggregations": {
  177. "googleA2": {
  178. "filter": {
  179. "bool": {
  180. "filter": [
  181. {
  182. "bool": {
  183. "should": [
  184. {
  185. "match_phrase": {
  186. "GoogleSearch.keyword": {
  187. "query": "facebook",
  188. "slop": 0,
  189. "boost": 1
  190. }
  191. }
  192. }
  193. ],
  194. "adjust_pure_negative": true,
  195. "boost": 1
  196. }
  197. }
  198. ],
  199. "adjust_pure_negative": true,
  200. "boost": 1
  201. }
  202. }
  203. },
  204. "amazonA2": {
  205. "filter": {
  206. "bool": {
  207. "filter": [
  208. {
  209. "bool": {
  210. "should": [
  211. {
  212. "match_phrase": {
  213. "AmazonOnSiteSearch.keyword": {
  214. "query": "hand spinner",
  215. "slop": 0,
  216. "boost": 1
  217. }
  218. }
  219. }
  220. ],
  221. "adjust_pure_negative": true,
  222. "boost": 1
  223. }
  224. }
  225. ],
  226. "adjust_pure_negative": true,
  227. "boost": 1
  228. }
  229. }
  230. },
  231. "google": {
  232. "filter": {
  233. "bool": {
  234. "filter": [
  235. {
  236. "bool": {
  237. "should": [
  238. {
  239. "match_phrase": {
  240. "GoogleSearch.keyword": {
  241. "query": "youtube",
  242. "slop": 0,
  243. "boost": 1
  244. }
  245. }
  246. }
  247. ],
  248. "adjust_pure_negative": true,
  249. "boost": 1
  250. }
  251. }
  252. ],
  253. "adjust_pure_negative": true,
  254. "boost": 1
  255. }
  256. }
  257. },
  258. "amazon": {
  259. "filter": {
  260. "bool": {
  261. "filter": [
  262. {
  263. "bool": {
  264. "should": [
  265. {
  266. "match_phrase": {
  267. "AmazonOnSiteSearch.keyword": {
  268. "query": "hand spinner",
  269. "slop": 0,
  270. "boost": 1
  271. }
  272. }
  273. }
  274. ],
  275. "adjust_pure_negative": true,
  276. "boost": 1
  277. }
  278. }
  279. ],
  280. "adjust_pure_negative": true,
  281. "boost": 1
  282. }
  283. }
  284. }
  285. }
  286. },
  287. "zeroActionsFiltering": {
  288. "bucket_selector": {
  289. "buckets_path": {
  290. "googleNumOfActions": "children>google._count",
  291. "amazonNumOfActions": "children>amazon._count",
  292. "googleA2NumOfActions": "children>googleA2._count",
  293. "amazonA2NumOfActions": "children>amazonA2._count"
  294. },
  295. "script": "(params.googleNumOfActions>0&&params.amazonNumOfActions>0)&&(params.googleA2NumOfActions>0&&params.amazonA2NumOfActions>0)"
  296. }
  297. },
  298. "commonNumOfActionsA1": {
  299. "bucket_script": {
  300. "buckets_path": {
  301. "googleNumOfActions": "children>google._count",
  302. "amazonNumOfActions": "children>amazon._count"
  303. },
  304. "script": "params.googleNumOfActions + params.amazonNumOfActions"
  305. }
  306. },
  307. "commonNumOfActionsA2": {
  308. "bucket_script": {
  309. "buckets_path": {
  310. "googleA2NumOfActions": "children>googleA2._count",
  311. "amazonA2NumOfActions": "children>amazonA2._count"
  312. },
  313. "script": "params.googleA2NumOfActions + params.amazonA2NumOfActions"
  314. }
  315. },
  316. "sumNumOfActionsAllAud": {
  317. "bucket_script": {
  318. "buckets_path": {
  319. "commonNumOfActionsA1": "commonNumOfActionsA1",
  320. "commonNumOfActionsA2": "commonNumOfActionsA2"
  321. },
  322. "script": "params.commonNumOfActionsA1+params.commonNumOfActionsA2"
  323. }
  324. },
  325. "thresholds": {
  326. "bucket_selector": {
  327. "buckets_path": {
  328. "commonNumOfActionsA1":"commonNumOfActionsA1",
  329. "commonNumOfActionsA2":"commonNumOfActionsA2",
  330. "sumNumOfActionsAllAud":"sumNumOfActionsAllAud"
  331. },
  332. "script": "params.sumNumOfActionsAllAud>=7"
  333. }
  334. }
  335. }
  336. }
  337. }
  338. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement