Skip to content

Instantly share code, notes, and snippets.

@nerandell
Last active November 4, 2016 05:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nerandell/3d1abd89bfe8d4997bc19079da7beccf to your computer and use it in GitHub Desktop.
Save nerandell/3d1abd89bfe8d4997bc19079da7beccf to your computer and use it in GitHub Desktop.
{
"query": {
"bool": {
"should": [
{
"function_score": {
"query": {
"bool": {
"must": [
{
"bool": {
"should": [
{
"bool": {
"must": [
{
"term": {
"tag": {
"value": "test",
"boost": 1
}
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"name": {
"value": "test",
"boost": 5
}
}
}
]
}
}
]
}
},
{
"bool": {
"filter": {
"term": {
"instanceid": "6"
}
}
}
}
]
}
},
"functions": [
{
"filter": {
"type": {
"value": "organizations"
}
},
"gauss": {
"updatedat": {
"scale": "10d"
}
}
}
]
}
},
{
"bool": {
"must": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"must": [
{
"term": {
"roles.title": {
"value": "test",
"boost": 4
}
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"identity": {
"value": "test",
"boost": 5
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"tag": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"organization": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"fullname": {
"value": "test",
"boost": 5
}
}
}
]
}
}
]
}
},
{
"bool": {
"filter": {
"term": {
"instanceid": "6"
}
}
}
}
]
}
},
{
"function_score": {
"query": {
"bool": {
"must": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"must": [
{
"term": {
"caseid": {
"value": "test",
"boost": 5
}
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"legacyid": {
"value": "test",
"boost": 5
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"subject": {
"value": "test",
"boost": 4
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"channel": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"priority": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"requesteremail": {
"value": "test",
"boost": 4
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"requestername": {
"value": "test",
"boost": 4
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"creatoremail": {
"value": "test",
"boost": 4
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"creatorname": {
"value": "test",
"boost": 4
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"team": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"assigneename": {
"value": "test",
"boost": 4
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"assigneeemail": {
"value": "test",
"boost": 4
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"field": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"body": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"postcreators": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"tag": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"brand": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"attachment": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"satisfaction": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"organization": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"casetype": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"casestatus": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"filter": {
"term": {
"instanceid": "6"
}
}
}
}
]
}
},
"functions": [
{
"filter": {
"bool": {
"should": [
{
"type": {
"value": "cases"
}
},
{
"type": {
"value": "archivedcases"
}
}
]
}
},
"gauss": {
"updatedat": {
"scale": "7d"
}
}
}
]
}
},
{
"function_score": {
"query": {
"bool": {
"must": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"must": [
{
"term": {
"caseid": {
"value": "test",
"boost": 5
}
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"legacyid": {
"value": "test",
"boost": 5
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"subject": {
"value": "test",
"boost": 4
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"channel": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"priority": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"requesteremail": {
"value": "test",
"boost": 4
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"requestername": {
"value": "test",
"boost": 4
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"creatoremail": {
"value": "test",
"boost": 4
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"creatorname": {
"value": "test",
"boost": 4
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"team": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"assigneename": {
"value": "test",
"boost": 4
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"assigneeemail": {
"value": "test",
"boost": 4
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"field": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"body": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"postcreators": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"tag": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"brand": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"attachment": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"satisfaction": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"organization": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"casetype": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"casestatus": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"filter": {
"term": {
"instanceid": "6"
}
}
}
}
]
}
},
"functions": [
{
"filter": {
"bool": {
"should": [
{
"type": {
"value": "cases"
}
},
{
"type": {
"value": "archivedcases"
}
}
]
}
},
"gauss": {
"updatedat": {
"scale": "7d"
}
}
}
]
}
},
{
"bool": {
"must": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"should": [
{
"bool": {
"must": [
{
"term": {
"tag": {
"value": "test",
"boost": 1
}
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"title": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"contents": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"contents_en-us": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"must": [
{
"term": {
"title_en-us": {
"value": "test",
"boost": 1
}
}
}
]
}
}
]
}
},
{
"bool": {
"filter": {
"term": {
"instanceid": "6"
}
}
}
}
]
}
}
],
"minimum_should_match": 1
}
},
"from": 0,
"size": 30,
"sort": {
"_score": {
"order": "desc"
},
"createdat": {
"order": "desc",
"ignore_unmapped": true
}
},
"highlight": {
"fields": {
"title": {},
"tag": {},
"name": {},
"identity": {},
"roles.title": {},
"organization": {},
"fullname": {},
"legacyid": {},
"caseid": {},
"subject": {},
"requesteremail": {},
"requestername": {},
"creatoremail": {},
"creatorname": {},
"assigneename": {},
"assigneeemail": {},
"attachment": {},
"status": {},
"casetype": {},
"type": {},
"satisfaction": {},
"field": {},
"brand": {},
"postcreators": {},
"body": {},
"team": {},
"priority": {},
"channel": {},
"casestatus": {},
"contents": {},
"contents_en-us": {},
"title_en-us": {}
},
"order": "score"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment