lucene-java-user mailing list archives

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

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.

--Peter

On 6/19/02 12:19 PM, "Srinivas.Kotamraju@bmsus.com"
<Srinivas.Kotamraju@bmsus.com> 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
> code..like below..give me the results sorted by date?
> thanks in advance.
> srini
> SearchBean sb = new SearchBean(index,formattedDate);
> HitsIterator hi = sb.search("metal");
> while (hi.hasNext())
> { Document doc = hi.next(); }
> 
> 
> 
> 
> 
> 
> 


--
To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


Mime
View raw message