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 Fanny Yeung <to...@hotmail.com> on 2002/06/19 17:22:50 UTC

Sorting

Hi,

I want to implement search function using Lucene. As I need to sort the 
result by number of indexed fields. (say 3 indexed fields). I am wondering 
how can I implement that. Can anyone give me some hints?

Thanks in advance,

Fanny

_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Sorting

Posted by Ype Kingma <yk...@xs4all.nl>.
Fanny,
>
>I want to implement search function using Lucene. As I need to sort the result by number of indexed fields. (say 3 indexed fields). I am wondering how can I implement that. Can anyone give me some hints?

The easiest way is to create an extra stored field with the number of remaining
fields.
You could also store the names of the remaining fields and count these
before sorting. This gives you the bonus of allowing to search for the
presence of a field.

Regards,
Ype

-- 

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>