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 Chris Hostetter <ho...@fucit.org> on 2010/04/01 04:05:12 UTC

Re: Query time only Ranges

: I am working on use case - wherein i need to Query to just time ranges
: without date component.
: 
: search for docs with between 4pm - 6pm 

if you only need to store the hour of the day, and query on the hour of 
the day, then i would just use a numeric integer field containing the hour 
of the day.

if you want minute or second (even even millisecond) granularity, but you 
still only care abotu the time of day (and note the *date*) then i would 
still use an integer field, and just index the numeric value in whatever 
granualrity you need.



-Hoss


RE: Query time only Ranges

Posted by Chris Hostetter <ho...@fucit.org>.
: Actually I needed time upto seconds granularity, so did you mean I 
: should index the field after conversion into seconds

it doesnt' relaly matter what granularity you need -- the point is if you 
need to query for things based on time of day, independent of hte actual 
date, then the best way to do this is probably to ignore the Solr 
DateField completely and just use a numeric field to index some unit of 
time as a number (it doesn't matter wether it's hours, minutes, seconds, 
or milliseconds -- use whatever makes hte most sense for your needs)

: if you only need to store the hour of the day, and query on the hour of 
: the day, then i would just use a numeric integer field containing the hour 
: of the day.
: 
: if you want minute or second (even even millisecond) granularity, but you 
: still only care abotu the time of day (and note the *date*) then i would 
: still use an integer field, and just index the numeric value in whatever 
: granualrity you need.

-Hoss


RE: Query time only Ranges

Posted by Ankit Bhatnagar <ab...@vantage.com>.
Hi Chris,
Actually I needed time upto seconds granularity, so did you mean I should index the field after conversion into seconds

Ankit

-----Original Message-----
From: Chris Hostetter [mailto:hossman_lucene@fucit.org] 
Sent: Wednesday, March 31, 2010 10:05 PM
To: solr-user@lucene.apache.org
Subject: Re: Query time only Ranges


: I am working on use case - wherein i need to Query to just time ranges
: without date component.
: 
: search for docs with between 4pm - 6pm 

if you only need to store the hour of the day, and query on the hour of 
the day, then i would just use a numeric integer field containing the hour 
of the day.

if you want minute or second (even even millisecond) granularity, but you 
still only care abotu the time of day (and note the *date*) then i would 
still use an integer field, and just index the numeric value in whatever 
granualrity you need.



-Hoss