lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Carlson <>
Subject Re: search bean and sorting
Date Thu, 20 Jun 2002 04:55:09 GMT

I currently use the SearchBean code (although I did refactor much of the
code in the contribution) to sort by date.

Your same code should work if you created a field "formattedDate"

Again, I haven't tested this new refactored code, so let me know if you run
into any problems.


On 6/19/02 12:19 PM, ""
<> wrote:

> hi carlson,
> i have seen your code contribution in the lucene sand box. I thank you for
> sharing it will all other developers.I am thinking of using it, but I am
> wondering If the sorting mechanism for a field you have implemented would
> also work for Dates? please let me know.
> I have a bunch of html files with metags like <META NAME="ISSUE_DATE"
> CONTENT="3/25/2002">
> and I am parsing the files and adding the dates using the DateField to my
> index.. 
> doc.add(Field.Keyword("date",DateField.dateToString(formattedDate)));
> I want the hits returned, to be sorted by date? would a call to ur
> below..give me the results sorted by date?
> thanks in advance.
> srini
> SearchBean sb = new SearchBean(index,formattedDate);
> HitsIterator hi ="metal");
> while (hi.hasNext())
> { Document doc =; }

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message