lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ype Kingma <ykin...@xs4all.nl>
Subject Re: Sorting
Date Thu, 20 Jun 2002 18:56:52 GMT
Fanny,

>Hi,
>
>Thanks the reply from Ype. Sorry, I am a newbie of lucene, would Ype give me more details
on how to implement it? Would the sorting affect the performance a lot?

You need to design the fields in your lucene documents first, ie.
what fields do you need, and what should be their name and contents.
This design will be determined by the output you need from
searches on your lucene index (or indices).

You might eg. add a field named 'fieldnames' that contains
the name of each the other fields in each lucene document.
The field should be stored and probably indexed.
This field could be added to your lucene document just before
you pass the document to the index writer.
See the lucene API documentation on how to do this.

Performance will most likely be limited by the retrieval of the stored field
from the lucene index, and not by the speed of counting and sorting.

Have fun,
Ype


>
>Many Thanks,
>
>Fanny
>
>>From: Ype Kingma <ykingma@xs4all.nl>
>>Reply-To: "Lucene Users List" <lucene-user@jakarta.apache.org>
>>To: "Lucene Users List" <lucene-user@jakarta.apache.org>
>>Subject: Re: Sorting
>>Date: Wed, 19 Jun 2002 19:40:59 +0100
>>
>>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:  
>><mailto:lucene-user-unsubscribe@jakarta.apache.org>
>>For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
>
>
>_________________________________________________________________
>Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
>
>
>--
>To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


-- 

--
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