Hmmm, why do you need a custom collector? You can use
the form of the search that returns a TopDocs, from which you
can get the max score and the array of ScoreDoc each of which
has its score. So you can just let the underlying code get the
top N documents, and throw out any that don't score above
1%.

HTH
Erick

On Thu, Jul 15, 2010 at 10:02 AM, dan sutton <danbsut...@gmail.com> wrote:

> Hi,
>
> I have a requirement to have a custom comparator that keep the top N
> documents (chosen by some criteria) but only if their score is more then
> e.g. 1% of the maxScore.
>
> Looking at SolrIndexSearcher.java, I was hoping to have a custom
> TopFieldCollector.java to return these via TopFieldCollector..topDocs, but
> I
> can't see how to override that class to provide my own, I think I need to
> do
> this here (TopFieldCollector..topDocs) as I won't know what the maxScore is
> until all the docs have been collected and compared?
>
> Does anyone have any suggestions? I'd like to avoid having to do two
> searches.
>
> Many Thanks,
> Dan
>

Reply via email to