You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Sal Mangano <sa...@into-technology.com> on 2004/06/05 20:31:43 UTC

Cocoon, Lucene and Date Ranges

I am using cocoon and lucene with great success on a current project. I am
using Cocoon's search generator (<map:generate type="search"/>). The one
part I have not figured out is how to implement date range filtering in my
search. I need to limit searches via a start date, end date or both. I think
I have a general idea of how to get the date info into the Lucene index but
don't know what needs to be done next. I have the feeling that I may need
implement my own generator or extend the existing one but before I go down
that path I'd like to know if there is a solution within the context of
available components. 

Thanks.

Sal

----------------------------------------------------------
Salvatore R. Mangano, President
sal.mangano@ into-technology.com
http://www.into-technology.com
Into Technology transforms software into enduring assets.
 
NOTICE: If received in error, please destroy and notify sender. Sender does
not waive confidentiality or privilege, and use is prohibited.
 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: Cocoon, Lucene and Date Ranges

Posted by Sal Mangano <sm...@ureach.com>.
I am going to answer my own question in case anyone else can benefit. It
turns out the answer is simple! Everything comes for free (I was just being
dense). If the lucene index was greated with date fields of the form
YYYYMMDD then you simply have to use a query string of the form
"date:[YYYYMMDD TO YYYYMMDD]" (eg. date:[20000101 TO 20040607]). Piece of
cake. In my case the date format was ISO (YYYY-MM-DD) but this works just as
well by sticking the dashes in the dates in the range.  
 
-Sal

> -----Original Message-----
> From: Sal Mangano [mailto:sal.mangano@into-technology.com] 
> Sent: Saturday, June 05, 2004 2:32 PM
> To: users@cocoon.apache.org
> Subject: Cocoon, Lucene and Date Ranges
> 
> 
> I am using cocoon and lucene with great success on a current 
> project. I am using Cocoon's search generator (<map:generate 
> type="search"/>). The one part I have not figured out is how 
> to implement date range filtering in my search. I need to 
> limit searches via a start date, end date or both. I think I 
> have a general idea of how to get the date info into the 
> Lucene index but don't know what needs to be done next. I 
> have the feeling that I may need implement my own generator 
> or extend the existing one but before I go down that path I'd 
> like to know if there is a solution within the context of 
> available components. 
> 
> Thanks.
> 
> Sal
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org