Skip to content

Instantly share code, notes, and snippets.

@rpetre
Created August 6, 2014 21:58
Show Gist options
  • Select an option

  • Save rpetre/29a77df40a3b844c38ae to your computer and use it in GitHub Desktop.

Select an option

Save rpetre/29a77df40a3b844c38ae to your computer and use it in GitHub Desktop.
Example ES filter search. If I remove the "raw" part, no results are found.
{
"facets": {
"map": {
"terms": {
"field": "geoip.country_code2.raw",
"size": 100,
"exclude": []
},
"facet_filter": {
"fquery": {
"query": {
"filtered": {
"filter": {
"bool": {
"must": [
{
"terms": {
"geoip.country_code2.raw": [
"US"
]
}
},
{
"range": {
"@timestamp": {
"from": 1407354889752,
"to": 1407356007765
}
}
}
]
}
}
}
}
}
}
}
},
"size": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment