Skip to content

Instantly share code, notes, and snippets.

@youngmaeng
Created October 13, 2011 05:45
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 youngmaeng/1283492 to your computer and use it in GitHub Desktop.
Save youngmaeng/1283492 to your computer and use it in GitHub Desktop.
Sample Query on 180 million documents 234.9GB data size
{
"from" : 0,
"size" : 30,
"query" : {
"filtered" : {
"query" : {
"bool" : {
"must" : {
"text" : {
"etype" : {
"query" : "10",
"type" : "phrase"
}
}
}
}
},
"filter" : {
"numeric_range" : {
"postdate" : {
"from" : "2011-09-29T07:00:00.000Z",
"to" : "2011-10-04T07:00:00.000Z",
"include_lower" : true,
"include_upper" : true
}
}
}
}
},
"explain" : false,
"sort" : [ {
"postdate" : {
"order" : "desc"
}
} ],
"facets" : {
"country" : {
"terms" : {
"field" : "country",
"size" : 20
}
},
"client_id" : {
"terms" : {
"field" : "client_id",
"size" : 100
}
},
"etype" : {
"terms" : {
"field" : "etype",
"size" : 100
}
},
"postdate" : {
"date_histogram" : {
"field" : "postdate",
"interval" : "week"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment