You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lucenenet.apache.org by Robert Pohl <ro...@f-i.com> on 2008/05/21 13:42:27 UTC

Return all, sort by date

Hi,

I'm creating a RSS feed of all the latest entries, and plan to get them by a
search.

How can I search for everything and sort by "date"?

When creating the index I set my document like this:
doc.Add(Field.Keyword("date", v.CreateDate.ToString()));

When searching I use MultiFieldQueryParser.


Thanks,
Robert Pohl


RE: Return all, sort by date

Posted by Robert Pohl <ro...@f-i.com>.
Ah ok, thanks!

//Rob

ROBERT POHL
Senior Application Developer • Fi Stockholm
 
T: +46 8 402 17 40
robert.pohl@f-i.com  /  www.f-i.com
 
This communication is confidential and is only intended for
the use of the individual or entity to which it is directed.
It may contain information that is privileged and exempt from
disclosure under applicable law. If you are not the Intended
recipient, please notify us immediately. You should not copy
it or disclose its content to any other person.


-----Original Message-----
From: Olivier Aboilard [mailto:olivier@marmiton.org] 
Sent: den 21 maj 2008 14:43
To: lucene-net-user@incubator.apache.org
Subject: Re: Return all, sort by date

Hi Robert,

you've got to format your date as a string of regular length which can 
be sorted : typically "20080521" that would stand for may, 21st 2008.

Hope it helps,
Olivier Aboilard

Robert Pohl a écrit :
> Hi,
>
> I'm creating a RSS feed of all the latest entries, and plan to get them by
a
> search.
>
> How can I search for everything and sort by "date"?
>
> When creating the index I set my document like this:
> doc.Add(Field.Keyword("date", v.CreateDate.ToString()));
>
> When searching I use MultiFieldQueryParser.
>
>
> Thanks,
> Robert Pohl
>
>
>   


No virus found in this incoming message.
Checked by AVG. 
Version: 8.0.100 / Virus Database: 269.23.21/1458 - Release Date: 5/21/2008
7:21 AM


Re: Return all, sort by date

Posted by Olivier Aboilard <ol...@marmiton.org>.
Hi Robert,

you've got to format your date as a string of regular length which can 
be sorted : typically "20080521" that would stand for may, 21st 2008.

Hope it helps,
Olivier Aboilard

Robert Pohl a écrit :
> Hi,
>
> I'm creating a RSS feed of all the latest entries, and plan to get them by a
> search.
>
> How can I search for everything and sort by "date"?
>
> When creating the index I set my document like this:
> doc.Add(Field.Keyword("date", v.CreateDate.ToString()));
>
> When searching I use MultiFieldQueryParser.
>
>
> Thanks,
> Robert Pohl
>
>
>