lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Taylor <watay...@as-st.com>
Subject Re: Sort by Date
Date Tue, 29 Aug 2006 20:47:19 GMT
i gave each of my documents a special field named date and I put in a 
normalized Lucene date with a precision of one day.  This date is 
yyyymmdd so that it can be sorted.  having done that, however, I am 
unsure how to ask Lucene to sort on that date, but I'll figure it out 
in time or someone will tell me.

On Aug 29, 2006, at 3:54 PM, Mag Gam wrote:

> "Index the date". Do you mean, index date, or the document date?
>
> Could this be in a LIA book?
>
>
>
> On 8/29/06, Erik Hatcher <erik@ehatchersolutions.com> wrote:
>>
>>
>> On Aug 29, 2006, at 11:50 AM, Mag Gam wrote:
>> > Is it possible to sort results by date of the document?
>>
>> Sure, check out the Sort class and the overloaded IndexSearcher.search
>> () methods that take a Sort.  You will need to index the date in a
>> sortable way. DateTools provides handy methods for this purpose.
>>
>>        Erik
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message