Strategy for date based searching and indexing

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Strategy for date based searching and indexing

Berlin Brown
I am using the most basic lucene functionality but using against a
database.  For example, I may have a message forum and will index that
message text and message subject from the database.  But I haven't
figured out a way to index the date.  ideally, when I search I should
be able to return the most recent and the relevant searches.  Possibly
even filtering by the last couple of days or something similar.

Does anybody have an example on how they indexed a date and/or with a
record from a database.

--
Berlin Brown
http://www.newspiritcompany.com - newspirit technologies

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Strategy for date based searching and indexing

Grant Ingersoll-2
Have a look at the DateTools utility class.   Also, the Wiki has some  
HOWTOs on Dates: http://wiki.apache.org/lucene-java/HowTo

Search this archive for Date handling, plus I believe the Lucene In  
Action book covers dates as well, although it might be a bit dated.

Lucene also comes with sort functionality that can handle dates.  
Have a look at the search API methods that pass in a Sort object.

-Grant

On Aug 19, 2007, at 3:23 AM, Berlin Brown wrote:

> I am using the most basic lucene functionality but using against a
> database.  For example, I may have a message forum and will index that
> message text and message subject from the database.  But I haven't
> figured out a way to index the date.  ideally, when I search I should
> be able to return the most recent and the relevant searches.  Possibly
> even filtering by the last couple of days or something similar.
>
> Does anybody have an example on how they indexed a date and/or with a
> record from a database.
>
> --
> Berlin Brown
> http://www.newspiritcompany.com - newspirit technologies
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

--------------------------
Grant Ingersoll
http://lucene.grantingersoll.com

Lucene Helpful Hints:
http://wiki.apache.org/lucene-java/BasicsOfPerformance
http://wiki.apache.org/lucene-java/LuceneFAQ



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]