Instantly share code, notes, and snippets.
Created
September 8, 2020 10:00
-
Star
(0)
0
You must be signed in to star a gist -
Fork
(0)
0
You must be signed in to fork a gist
-
Save byronvoorbach/8b20a97a72c1e85589ffbec253b693b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ten cate | |
#dekbed | |
#foodstars | |
#ecosym | |
#paraplu | |
#balkenbrij | |
#allerhande box | |
#ube | |
#overhemd | |
#cantharellen | |
#boerinneke | |
#nijntje | |
#kwarteleieren | |
#cool bear | |
#beschuitbollen | |
#elastiekjes | |
#ariel baby | |
GET productservice-1-product-ahwebshop-latest-debug/_search/template | |
{ | |
"params": { | |
"term": "ariel baby", | |
"time": "now/d" | |
}, | |
"source": { | |
"size": 1, | |
"_source": [ | |
"description", | |
"brand", | |
"ah2_taxonomyLevels" | |
], | |
"query": { | |
"bool": { | |
"should": [ | |
{ | |
"bool": { | |
"_name": "available_false", | |
"must": [ | |
{ | |
"multi_match": { | |
"query": "{{term}}", | |
"operator": "and", | |
"type": "cross_fields", | |
"fields": [ | |
"description.ah2_default", | |
"brand.ah2_default", | |
"ah2_taxonomyLevels.ah2_default" | |
] | |
} | |
} | |
], | |
"filter": [ | |
{ | |
"term": { | |
"availableOnline": false | |
} | |
} | |
] | |
} | |
}, | |
{ | |
"bool": { | |
"boost": 100, | |
"_name": "available_true", | |
"must": [ | |
{ | |
"multi_match": { | |
"query": "{{term}}", | |
"type": "cross_fields", | |
"operator": "and", | |
"fields": [ | |
"description.ah2_default", | |
"brand.ah2_default", | |
"ah2_taxonomyLevels.ah2_default" | |
] | |
} | |
} | |
], | |
"filter": [ | |
{ | |
"term": { | |
"availableOnline": true | |
} | |
}, | |
{ | |
"term": { | |
"assortments": "B2C" | |
} | |
}, | |
{ | |
"range": { | |
"visibilities": { | |
"gte": "{{time}}", | |
"lte": "{{time}}", | |
"relation": "contains" | |
} | |
} | |
}, | |
{ | |
"nested": { | |
"path": "catalogs", | |
"query": { | |
"bool": { | |
"must": [ | |
{ | |
"range": { | |
"catalogs.availabilityPeriod": { | |
"gte": "{{time}}", | |
"lte": "{{time}}", | |
"relation": "intersects" | |
} | |
} | |
} | |
] | |
} | |
} | |
} | |
}, | |
{ | |
"exists": { | |
"field": "ah2_taxonomyLevels" | |
} | |
} | |
] | |
} | |
} | |
] | |
} | |
}, | |
"aggs": { | |
"available_false": { | |
"filter": { | |
"bool": { | |
"_name": "available_false", | |
"must": [ | |
{ | |
"multi_match": { | |
"query": "{{term}}", | |
"operator": "and", | |
"type": "cross_fields", | |
"fields": [ | |
"description.ah2_default", | |
"brand.ah2_default", | |
"ah2_taxonomyLevels.ah2_default" | |
] | |
} | |
} | |
], | |
"filter": [ | |
{ | |
"term": { | |
"availableOnline": false | |
} | |
} | |
] | |
} | |
} | |
}, | |
"available_true": { | |
"filter": { | |
"bool": { | |
"boost": 100, | |
"_name": "available_true", | |
"must": [ | |
{ | |
"multi_match": { | |
"query": "{{term}}", | |
"type": "cross_fields", | |
"operator": "and", | |
"fields": [ | |
"description.ah2_default", | |
"brand.ah2_default", | |
"ah2_taxonomyLevels.ah2_default" | |
] | |
} | |
} | |
], | |
"filter": [ | |
{ | |
"term": { | |
"availableOnline": true | |
} | |
}, | |
{ | |
"term": { | |
"assortments": "B2C" | |
} | |
}, | |
{ | |
"range": { | |
"visibilities": { | |
"gte": "{{time}}", | |
"lte": "{{time}}", | |
"relation": "contains" | |
} | |
} | |
}, | |
{ | |
"nested": { | |
"path": "catalogs", | |
"query": { | |
"bool": { | |
"must": [ | |
{ | |
"range": { | |
"catalogs.availabilityPeriod": { | |
"gte": "{{time}}", | |
"lte": "{{time}}", | |
"relation": "intersects" | |
} | |
} | |
} | |
] | |
} | |
} | |
} | |
}, | |
{ | |
"exists": { | |
"field": "ah2_taxonomyLevels" | |
} | |
} | |
] | |
} | |
} | |
} | |
}, | |
"highlight": { | |
"fields": { | |
"*": {} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment