lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ankit Bhatnagar <>
Subject RE: Reg: Indexing Date Fields
Date Thu, 15 Apr 2010 13:16:37 GMT
Hi Venkat,
It depends on your use-  case, but if want to query for time(with whatever granularity) then
'int' is good.

However if you just wan to query for date range then [date1 TO date2] should be fine.


-----Original Message-----
From: Jean-Sebastien Vachon [] 
Sent: Thursday, April 15, 2010 9:09 AM
Subject: Re: Reg: Indexing Date Fields

I guess you can simply use a range query such as:

fq=createdDate:[ date1 TO date2 ]

On 2010-04-15, at 7:30 AM, Venkata Sai Krishna Vepakomma wrote:

> Hi,
> 1) How do I query for Data between 2 date ranges.  I have specified the following field
definition in Schema.xml.
>   <field name="createdDate"  type="long" indexed="true" stored="true" />
> I have long values for Date fields.  When I query with long values, I am always getting
all the results.
> 2) For indexing to be working efficiently and for querying between Date ranges, Is it
OK to use long values or Do I need to use 'Date' type with specific formats.
> Please Let me know your thoughts.
> Thanks & Regards
> Venkat

View raw message