You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Amit Soni <am...@netcore.co.in> on 2006/10/05 14:39:41 UTC

sort ordering

Hi all,

I have been using Lucene from last few days. Right now i am reading some 
records from the db then convert in Document of lucene and then adds 
that document in lucene index. But in my record i have one field which 
is created_date and i want to search for given query in created_date 
order. So is it possible to search in date order. If any one of you have 
some idea regarding this then please let me know.

Thanks,
Amit Soni

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


Re: sort ordering

Posted by Erick Erickson <er...@gmail.com>.
Search the mail archives for "date" and "sort" and you'll get many, many
responses. The short form is look at the DateTools class, and also look at
the Sort class.

Be aware that there are several issues regarding *ranges* of dates if you
have a need to search over, say, "all dates from 20060101 to 20061010" for
instance. You want to be mindful of the resolution of your dates.

But, as I said, you'll get lots and lots of information if you search the
list archive. There's also explications of this in Lucene In Action.

Best
Erick

On 10/5/06, Amit Soni <am...@netcore.co.in> wrote:
>
> Hi all,
>
> I have been using Lucene from last few days. Right now i am reading some
> records from the db then convert in Document of lucene and then adds
> that document in lucene index. But in my record i have one field which
> is created_date and i want to search for given query in created_date
> order. So is it possible to search in date order. If any one of you have
> some idea regarding this then please let me know.
>
> Thanks,
> Amit Soni
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>