You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Danicela nutch <Da...@mail.com> on 2011/11/22 18:02:46 UTC

Re : AW: How to select all docs of 'today' ?

Thanks it works.

 All this is based on the fact that NOW/DAY means the beginning of the day.

----- Message d'origine -----
De : Sebastian.Peters@tib.uni-hannover.de
Envoyés : 22.11.11 16:46
À : solr-user@lucene.apache.org
Objet : AW: How to select all docs of 'today' ?

 Hi, "fetch-time:[NOW/DAY TO NOW]" should do it. Best Sebastian -----Ursprüngliche Nachricht----- Von: Danicela nutch [mailto:Danicela-nutch@mail.com] Gesendet: Dienstag, 22. November 2011 16:08 An: solr-user@lucene.apache.org Betreff: How to select all docs of 'today' ? Hi, I have a fetch-time (date) field to know when the documents were fetched. I want to make a query to get all documents fetched today. I tried : fetch-time:NOW/DAY but it returns always 0. fetch-time:[NOW/DAY TO NOW/DAY] (it returns 0) fetch-time:[NOW/DAY-1DAY TO NOW/DAY] but it returns documents fetched yesterday. fetch-time:[NOW/DAY-1HOUR TO NOW/DAY] but it's incorrect too. Do you have any idea ? Thanks in advance.

Re: Re : AW: How to select all docs of 'today' ?

Posted by Erick Erickson <er...@gmail.com>.
One subtlety to note is that caching is messed up by this form
since NOW evaluates to the second, and submitting two
successive queries exactly like this won't re-use the cache. On
a query like this it may not matter unless you're paging....

But on filter queries, its a good habit to cultivate to write
something like
[NOW/DAY TO NOW/DAY+1DAY]
which will be reused until midnight tonight.......

Best
Erick

On Tue, Nov 22, 2011 at 12:02 PM, Danicela nutch
<Da...@mail.com> wrote:
> Thanks it works.
>
>  All this is based on the fact that NOW/DAY means the beginning of the day.
>
> ----- Message d'origine -----
> De : Sebastian.Peters@tib.uni-hannover.de
> Envoyés : 22.11.11 16:46
> À : solr-user@lucene.apache.org
> Objet : AW: How to select all docs of 'today' ?
>
>  Hi, "fetch-time:[NOW/DAY TO NOW]" should do it. Best Sebastian -----Ursprüngliche Nachricht----- Von: Danicela nutch [mailto:Danicela-nutch@mail.com] Gesendet: Dienstag, 22. November 2011 16:08 An: solr-user@lucene.apache.org Betreff: How to select all docs of 'today' ? Hi, I have a fetch-time (date) field to know when the documents were fetched. I want to make a query to get all documents fetched today. I tried : fetch-time:NOW/DAY but it returns always 0. fetch-time:[NOW/DAY TO NOW/DAY] (it returns 0) fetch-time:[NOW/DAY-1DAY TO NOW/DAY] but it returns documents fetched yesterday. fetch-time:[NOW/DAY-1HOUR TO NOW/DAY] but it's incorrect too. Do you have any idea ? Thanks in advance.
>