Skip to content

Instantly share code, notes, and snippets.

@Fifciu
Created December 4, 2019 16:50
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 Fifciu/798d09880620dbff1230018e4fc42ca4 to your computer and use it in GitHub Desktop.
Save Fifciu/798d09880620dbff1230018e4fc42ca4 to your computer and use it in GitHub Desktop.
{
"size": 0,
"query": {
"bool": {
"filter": {
"bool": {
"must": [
{
"term": {
"type_id": "configurable"
}
},
{
"terms": {
"status": [
0,
1
]
}
},
{
"terms": {
"visibility": [
2,
3,
4
]
}
},
{
"term": {
"stock.is_in_stock": true
}
},
{
"range": {
"configurable_children.stock.qty": {
"gt": 0
}
}
}
]
}
},
"must": {
"terms": {
"category_ids": [
3
]
}
}
}
},
"aggs": {
"colors": {
"terms": {
"field": "configurable_children.color_group",
"size": 11
}
},
"sizes": {
"terms": {
"field": "talla_options"
}
},
"styles": {
"terms": {
"field": "configurable_children.style"
}
},
"prints": {
"terms": {
"field": "configurable_children.print"
}
},
"lengths": {
"terms": {
"field": "length.keyword"
}
},
"featureds": {
"terms": {
"field": "configurable_children.featured.keyword"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment