Re: Making TopDocCollector a bit more consumable

2009-08-24 Thread Shai Erera
This is tricky (and even now I wrote this email twice). It is all about mating a Scorer and Collector together: * Any out-of-order Scorer can be fed into an acceptsOutOfOrder Collector. * Any in-order Scorer can be fed into either accepts=true/false Collector. Therefore, when Weight is *queried*

Re: Making TopDocCollector a bit more consumable

2009-08-24 Thread Mark Miller
Mark Miller wrote: >> >>* >>* @param docsScoredInOrder >>* specifies if documents will be scored in doc ID order by the >>* query. If you're not sure in advance, you can do the >> following: >>* >>* boolean docsScoredInOrder = >> !q.weigh

Re: Making TopDocCollector a bit more consumable

2009-08-24 Thread Mark Miller
I can just pop it in - thanks a lot. I like the little example myself. It says a lot I think. Shai Erera wrote: > I guess we can add something like this: > >* >* @param docsScoredInOrder >* specifies if documents will be scored in doc ID order by the >* query. If

Re: Making TopDocCollector a bit more consumable

2009-08-24 Thread Shai Erera
I guess we can add something like this: * * @param docsScoredInOrder * specifies if documents will be scored in doc ID order by the * query. If you're not sure in advance, you can do the following: * * boolean docsScoredInOrder = !q.weight(sea

Re: Making TopDocCollector a bit more consumable

2009-08-24 Thread Mark Miller
Thanks Shai. That all makes sense to me. bq. Perhaps we should add to the javadocs something like "you can call query.weight().scoresDocsOutOfOrder to instantiate the optimal TFC/TSDC"? I guess this is all I would argue for as well - basically a bit more informative javadoc for scoreOutOfOrder:

Re: Making TopDocCollector a bit more consumable

2009-08-24 Thread Shai Erera
I think we've had a similar discussion on this issue (as part of the JIRA issue), and the reason for not defaulting to anything was back-compat. For example, we know that not tracking doc scores is better when you simply sort by a field. But we can't have a default that says "don't track doc score

Re: Making TopDocCollector a bit more consumable

2009-08-24 Thread Mark Miller
We do still mark the collector methods as lower level API - so I guess my expert/non expert argument is pretty worthless :) I just don't like that the collectors require so much more internal knowledge to use than the previous versions - and just for optimization. The param list can be very simple

Re: Making TopDocCollector a bit more consumable

2009-08-24 Thread Mark Miller
I was just going to add actually: Yes you can just use the other Searcher methods. Perhaps thats just fine. I don't think this a large issue. But you could also use void search(Weight weight, Filter filter, Collector collector). I've created my own TopDocs collectors for a handful of reasons in

Re: Making TopDocCollector a bit more consumable

2009-08-24 Thread Yonik Seeley
But creating the collector is expert use, right? The normal use would be from Searcher: TopDocs search(Query query, int n) TopDocs search(Query query, Filter filter, int n) -Yonik http://www.lucidimagination.com On Mon, Aug 24, 2009 at 10:15 AM, Mark Miller wrote: > Hey all, > > Hits, which us