Return a single document per user per hour

(John) #1

Is there a way to return a single document per hour?
Another way to describe what I'm after: I'm thinking of a "date histogram" type scenario, but within the query, not with aggregations.

The data is basically a table with users' activity per hour (timestamp), with some values associated with their activity recorded at each hour. They can be active in more than one way (resulting in multiple documents per hour), but for this query, I'd like to simply grab a single document with information per hour, for each user. Is this possible?


(Mark Walkom) #2

Which document would you grab though?

(John) #3

In this case, it doesn't matter which document, just that I can grab a single one. Order doesn't matter, I just want to use some of the meta data in the other fields.

(Mark Walkom) #4

What about just using a filtered query with a date range attached to it?

(John) #5

The hour is kind of an arbitrary amount and I'm looking for something more scalable. In the future I might be looking for per minute data. I think something like top_hits might be closer to what I'm looking for.

(system) #6

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.