: What's the performance impact of doing this? the function approach should have slower query times compared to the "new field containing day" approach because it has to do the computation for every doc at query time, but it's less flexible because you have to know in advance you want to use it that way -- the classic classic "precompute work when indexing to save time during query" trade off.
A key thing to keep in mind though with both of these suggestions is wether you really want a single group for every day, for all of time.... : >> second. I'm able to easily use this field to create day-based facets, but : >> not groups. Advice please? if you compare this to range/date faceting then there is a start/end date, and documents which fall outside of those dates get included in before/after ranges -- this wouldnt' happen if you used either of the two suggestions above. The closest analog available in grouping would be to use a series of "group.query" params, specifying the ranges of values you wanted -- this is essentialy what range faceting is doing under the covers. if the goal is something like :group by day for the last 7 days, and everything else should be in a single 'older' bucket", then sending 8 group.query params containing range queries should work fine. -Hoss