Skip to content

Instantly share code, notes, and snippets.

@jclaveau
Created September 14, 2016 09:33
Show Gist options
  • Save jclaveau/f43f171b834af2a8ecb48cc9552aa688 to your computer and use it in GitHub Desktop.
Save jclaveau/f43f171b834af2a8ecb48cc9552aa688 to your computer and use it in GitHub Desktop.
{
index: "mediaevents_10-09-2016,mediaevents_11-09-2016,mediaevents_12-09-2016",
ignore_unavailable: true,
body: {
query: {
constant_score: {
filter: {
bool: {
must: [
{
range: {
date: {
from: "2016-09-10 00:00:00",
to: "2016-09-12 23:59:59"
}
}
},
[
{
terms: {
event: [
"inventory"
]
}
}
],
[
{
terms: {
publisher_id: [
"723"
]
}
}
]
]
}
}
}
},
aggregations: {
group_by_device: {
terms: {
field: "metadata.device_type",
size: 1000000
},
aggregations: {
group_by_publisher_id: {
terms: {
field: "publisher_id",
size: 1000000
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment