: We're not using TopDocCollector right now, as we're still using Hits.
: Performing some operation over every result is just one use case.  We also
: have to deal with the user scrolling the display.  Currently this works
: acceptably using the same java.util.List model for both cases. Sometimes a
: bulk operation needs to iterate over the items more than once, which makes it
: trickier to invert (I guess we'd have to perform the search twice.  And then

Hits doesn't give you any advantage here either -- you still have to 
execute the search twice one the user scrolls past the end of the list of 
docs fetched so far, that second search is just happening under the covers 
so you don't see it -- and you have no control over it.  you can't give 
Hits any hint about how much big to make the queue on each pass, you can't 
aren't given any indication when it's happening so you can pop up a 
"please wait" cursor or anything.

That (in my opinion) is the fundemental problem with Hits: it does too 
much under the covers.

: > At the end of the day: people switching to using TopDocsCollector instead of
: > Hits are no worse off when trying to iterate over every result in a
: > ginormous result set, they're just have to define "ginormous" for
: > themselves, and the get an OOM right away instead of once they iterate up to
: > that many.
: 
: This is effectively our problem, if it fails fast the user just says "well why
: couldn't I even see the first 10 results?"  It's much better to fail with an
: OOM later when retrieving result someBigValue + 1.

but that's really a differnet use case from what i was describing (knowing 
in advance that you definitely want to iterate over all results) 

if you're dealing with a UI, go ahead and give TopDocsCollector a small 
limit, something managable and enough to show the user the first N that 
they want to see ... but now *you* control what N is, and *you* can decide 
if/when to fetch N (or some different amount) more docs based the actions 
the user takes.



-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to