Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "size": 0,
- "query": {
- "bool": {
- "filter": [
- {
- "bool": {
- "should": [
- {
- "has_child": {
- "query": {
- "bool": {
- "filter": [
- {
- "bool": {
- "should": [
- {
- "match_phrase": {
- "GoogleSearch.keyword": {
- "query": "facebook",
- "slop": 0,
- "boost": 1
- }
- }
- }
- ],
- "adjust_pure_negative": true,
- "boost": 1
- }
- }
- ],
- "adjust_pure_negative": true,
- "boost": 1
- }
- },
- "type": "action",
- "score_mode": "none",
- "min_children": 0,
- "max_children": 2147483647,
- "ignore_unmapped": false,
- "boost": 1
- }
- },
- {
- "has_child": {
- "query": {
- "bool": {
- "filter": [
- {
- "bool": {
- "should": [
- {
- "match_phrase": {
- "AmazonOnSiteSearch.keyword": {
- "query": "hand spinner",
- "slop": 0,
- "boost": 1
- }
- }
- }
- ],
- "adjust_pure_negative": true,
- "boost": 1
- }
- }
- ],
- "adjust_pure_negative": true,
- "boost": 1
- }
- },
- "type": "action",
- "score_mode": "none",
- "min_children": 0,
- "max_children": 2147483647,
- "ignore_unmapped": false,
- "boost": 1
- }
- }
- ]
- }
- },
- {
- "bool": {
- "should": [
- {
- "has_child": {
- "query": {
- "bool": {
- "filter": [
- {
- "bool": {
- "should": [
- {
- "match_phrase": {
- "GoogleSearch.keyword": {
- "query": "youtube",
- "slop": 0,
- "boost": 1
- }
- }
- }
- ],
- "adjust_pure_negative": true,
- "boost": 1
- }
- }
- ],
- "adjust_pure_negative": true,
- "boost": 1
- }
- },
- "type": "action",
- "score_mode": "none",
- "min_children": 0,
- "max_children": 2147483647,
- "ignore_unmapped": false,
- "boost": 1
- }
- },
- {
- "has_child": {
- "query": {
- "bool": {
- "filter": [
- {
- "bool": {
- "should": [
- {
- "match_phrase": {
- "AmazonOnSiteSearch.keyword": {
- "query": "spinner",
- "slop": 0,
- "boost": 1
- }
- }
- }
- ],
- "adjust_pure_negative": true,
- "boost": 1
- }
- }
- ],
- "adjust_pure_negative": true,
- "boost": 1
- }
- },
- "type": "action",
- "score_mode": "none",
- "min_children": 0,
- "max_children": 2147483647,
- "ignore_unmapped": false,
- "boost": 1
- }
- }
- ],
- "adjust_pure_negative": true,
- "boost": 1
- }
- }
- ],
- "adjust_pure_negative": true,
- "boost": 1
- }
- },
- "aggregations": {
- "group_by": {
- "terms": {
- "field": "uuid",
- "size":100000
- },
- "aggs": {
- "children": {
- "children": {
- "type": "action"
- },
- "aggregations": {
- "googleA2": {
- "filter": {
- "bool": {
- "filter": [
- {
- "bool": {
- "should": [
- {
- "match_phrase": {
- "GoogleSearch.keyword": {
- "query": "facebook",
- "slop": 0,
- "boost": 1
- }
- }
- }
- ],
- "adjust_pure_negative": true,
- "boost": 1
- }
- }
- ],
- "adjust_pure_negative": true,
- "boost": 1
- }
- }
- },
- "amazonA2": {
- "filter": {
- "bool": {
- "filter": [
- {
- "bool": {
- "should": [
- {
- "match_phrase": {
- "AmazonOnSiteSearch.keyword": {
- "query": "hand spinner",
- "slop": 0,
- "boost": 1
- }
- }
- }
- ],
- "adjust_pure_negative": true,
- "boost": 1
- }
- }
- ],
- "adjust_pure_negative": true,
- "boost": 1
- }
- }
- },
- "google": {
- "filter": {
- "bool": {
- "filter": [
- {
- "bool": {
- "should": [
- {
- "match_phrase": {
- "GoogleSearch.keyword": {
- "query": "youtube",
- "slop": 0,
- "boost": 1
- }
- }
- }
- ],
- "adjust_pure_negative": true,
- "boost": 1
- }
- }
- ],
- "adjust_pure_negative": true,
- "boost": 1
- }
- }
- },
- "amazon": {
- "filter": {
- "bool": {
- "filter": [
- {
- "bool": {
- "should": [
- {
- "match_phrase": {
- "AmazonOnSiteSearch.keyword": {
- "query": "hand spinner",
- "slop": 0,
- "boost": 1
- }
- }
- }
- ],
- "adjust_pure_negative": true,
- "boost": 1
- }
- }
- ],
- "adjust_pure_negative": true,
- "boost": 1
- }
- }
- }
- }
- },
- "zeroActionsFiltering": {
- "bucket_selector": {
- "buckets_path": {
- "googleNumOfActions": "children>google._count",
- "amazonNumOfActions": "children>amazon._count",
- "googleA2NumOfActions": "children>googleA2._count",
- "amazonA2NumOfActions": "children>amazonA2._count"
- },
- "script": "(params.googleNumOfActions>0&¶ms.amazonNumOfActions>0)&&(params.googleA2NumOfActions>0&¶ms.amazonA2NumOfActions>0)"
- }
- },
- "commonNumOfActionsA1": {
- "bucket_script": {
- "buckets_path": {
- "googleNumOfActions": "children>google._count",
- "amazonNumOfActions": "children>amazon._count"
- },
- "script": "params.googleNumOfActions + params.amazonNumOfActions"
- }
- },
- "commonNumOfActionsA2": {
- "bucket_script": {
- "buckets_path": {
- "googleA2NumOfActions": "children>googleA2._count",
- "amazonA2NumOfActions": "children>amazonA2._count"
- },
- "script": "params.googleA2NumOfActions + params.amazonA2NumOfActions"
- }
- },
- "sumNumOfActionsAllAud": {
- "bucket_script": {
- "buckets_path": {
- "commonNumOfActionsA1": "commonNumOfActionsA1",
- "commonNumOfActionsA2": "commonNumOfActionsA2"
- },
- "script": "params.commonNumOfActionsA1+params.commonNumOfActionsA2"
- }
- },
- "thresholds": {
- "bucket_selector": {
- "buckets_path": {
- "commonNumOfActionsA1":"commonNumOfActionsA1",
- "commonNumOfActionsA2":"commonNumOfActionsA2",
- "sumNumOfActionsAllAud":"sumNumOfActionsAllAud"
- },
- "script": "params.sumNumOfActionsAllAud>=7"
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement