lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aleksander M. Stensby" <aleksander.sten...@integrasco.no>
Subject Re: Query on date fields
Date Fri, 12 Jun 2009 08:44:43 GMT
Hello,
for this you can simply use the nifty date functions supplied by SOLR  
(given that you have indexed your fields with the solr Date field.

If I understand you correctly, you can achieve what you want with the  
following union query:

displayStartDate:[* TO NOW] AND displayEndDate:[NOW TO *]

Cheers,
  Aleksander



On Mon, 08 Jun 2009 09:17:26 +0200, prerna07 <pkhandelwal2@sapient.com>  
wrote:

>
>
> Hi,
>
> I have two date attributes in my Indexes:
>
> DisplayStartDate_dt
> DisplayEndDate_dt
>
> I need to fetch results where today's date lies between displayStartDate  
> and
> dislayEndDate.
>
> However i cannot send hardcoded displayStartdate and displayEndDate date  
> in
> query as there are 1000 different dates in indexes
>
> Please suggest the query.
>
> Thanks,
> Prerna
>
>
>
>



-- 
Aleksander M. Stensby
Lead software developer and system architect
Integrasco A/S
www.integrasco.no
http://twitter.com/Integrasco

Please consider the environment before printing all or any of this e-mail

Mime
View raw message