Filter (range filter on the date/time field) is exactly the way to do this.
Another possibility is using rolling indexes (e.g. an index per day, like the logstash indexes are defined) but that obviously depends on a lot of other business concerns and isn't really viable for most applications -- Itamar Syn-Hershko http://code972.com | @synhershko <https://twitter.com/synhershko> Freelance Developer & Consultant Author of RavenDB in Action <http://manning.com/synhershko/> On Fri, Apr 18, 2014 at 12:36 AM, Phil Greenberg < [email protected]> wrote: > I am also facing the same issue. > > Right now, I am just doing a filter myself, but I would assume this is a > common use case, an ES must have a way to deal with it? > > > On Tuesday, April 15, 2014 6:24:52 PM UTC-7, Joris Bolsens wrote: >> >> I am using the javascript API and want to do a search and have it search >> through the most recent objects, IE I call a search with size 100, I want >> to have the most recent 100 objects returned to me, how would I go about >> doing that? >> >> I tried using sort, but it seems that it just sorts the results after the >> search completed >> > -- > You received this message because you are subscribed to the Google Groups > "elasticsearch" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elasticsearch/fb4a3d83-c386-459b-beb6-a8ca4fcbb286%40googlegroups.com<https://groups.google.com/d/msgid/elasticsearch/fb4a3d83-c386-459b-beb6-a8ca4fcbb286%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "elasticsearch" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAHTr4Zu9B78T_aOECERuo0THM29fs%3DVXavesSC4n2P7rFRFBtA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
