I did something similar.

The only difference with my set up is that I have two columns; one that
store the dates the document was first created and a second that stores the
date it was last updated as unix time stamps

So my query to find documents that are older than 4 hours would be very easy

To find documents that were last updated more than for hours ago you would
do something like this

q=last_update_date:[* TO 1270119278]

The current timestamp now is 1270133678. 4 hours ago was 1270119278

The column types in the schema is tint



On Wed, Mar 31, 2010 at 11:18 PM, herceg_novi <herceg_n...@yahoo.com> wrote:

>
> Hello, I'd like to select documents older than 4 hours in my Solr 1.4
> installation.
>
> The query
>
> q=last_update_date:[NOW-7DAYS TO NOW-4HOURS]
>
> does not return a correct recordset. I would expect to get all documents
> with last_update_date in the specified range. Instead solr returns all
> documents that exist in the index which is not what I would expect.
> Last_update_date is SolrDate field.
>
> This does not work either
> q=last_update_date:[NOW/DAY-7DAYS TO NOW/HOUR-4HOURS]
>
> This works, but I manually had to calculate the 4 hour difference and
> insert
> solr date formated timestamp into my query (I prefer not to do that)
> q=last_update_date:[NOW/DAY-7DAYS TO 2010-03-31T19:40:34Z]
>
> Any ideas if I can get this to work as expected?
> q=last_update_date:[NOW-7DAYS TO NOW-4HOURS]
>
> Thanks!
> --
> View this message in context:
> http://n3.nabble.com/selecting-documents-older-than-4-hours-tp689975p689975.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
"Good Enough" is not good enough.
To give anything less than your best is to sacrifice the gift.
Quality First. Measure Twice. Cut Once.
http://www.israelekpo.com/

Reply via email to