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 Ram Peters <ra...@gmail.com> on 2007/05/06 16:08:28 UTC

Search Result cutoff

How do you specify cutoff on search results?  If I want to sort the
search result, on other than relevancy, I don't want non related stuff
showing up at the top.  Is there way to set a cutoff, so only result
that falls between certain range are displayed?

Thanks.

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


Re: Search Result cutoff

Posted by Erick Erickson <er...@gmail.com>.
Well, "falls between a certain range" is problematical. There's
nothing hard and fast about scoring. That is, scores between, say,
two different queries are not comparable.

But I really don't understand the question. You won't get
"unrelated stuff" in your result set as far as I know. Everything
has a relevancy > 0. But what you *do* get is sorted by other
than relevancy. Admittedly, it can be pretty limited in relevance,
since the lowest document (by relevance) may bethe first in
the list because of your sorting.

But let's assume that your question is really something I actually
have experience with. That is, "how can I apply the sorting to the
first N of the most-relevant documents?". I used a TopDocs object
and threw the first N documents into a FieldSortedHitQueue
(Lucene 2.1, not sure how much earlier this is available). Which
has been working like a champ.

Best
Erick


On 5/6/07, Ram Peters <ra...@gmail.com> wrote:
>
> How do you specify cutoff on search results?  If I want to sort the
> search result, on other than relevancy, I don't want non related stuff
> showing up at the top.  Is there way to set a cutoff, so only result
> that falls between certain range are displayed?
>
> Thanks.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>