I am new to elastic search and would like to know if the following can be done with normal term, range queries and sorting or whether I need to use elastic search aggregation querying
I have a set of documents with several string fields and one date field. I would like to select the top N of those documents that match exactly (term queries) two of the string fields and whose date is within some date range and get the counts of those top N docs
A typical doc will be
{ "_id" : ObjectId("55b0a8b448f3bdb6bf26683c"),
"type" : "type1",
"time-gmt" : ISODate("2015-07-23T08:41:29.299Z"),
"sID" : "id1"}
I would like to find, say the top 10 docs of type="type 1" in a certain "time-gmt" range as well as how many of those 10 top docs there are. So a table of the result set would
sID1 120
sID2 100
sID3 90
...
sID10 3