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
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
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
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
So are you saying it's not possible to ask ES for the most recent X objects
that match the given query? Only to say give me the last 30 days of
objects?
On Thursday, April 17, 2014 2:39:43 PM UTC-7, Itamar Syn-Hershko wrote:
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
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
So are you saying it's not possible to ask ES for the most recent X
objects that match the given query? Only to say give me the last 30 days
of objects?
On Thursday, April 17, 2014 2:39:43 PM UTC-7, Itamar Syn-Hershko wrote:
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
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
So are you saying it's not possible to ask ES for the most recent X
objects that match the given query? Only to say give me the last 30 days
of objects?
On Thursday, April 17, 2014 2:39:43 PM UTC-7, Itamar Syn-Hershko wrote:
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
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
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.