Yes, I saw that. I would expect that to be slower. It also would not always work as expected if the collector would be combined in a booleanquery I guess.
Anne On Wed, Sep 7, 2011 at 15:29, Robert Muir <[email protected]> wrote: > On Wed, Sep 7, 2011 at 9:09 AM, Anne Veling <[email protected]> wrote: > > Ah thanks. I will make the change, ensure all tests are succeeding, add > some > > tests of my own, and commit a patch. Would be great to get a feeling of > the > > performance impact. > > The change I'm making is changing the Collector interface from > > public void collect(int doc) to > > public boolean collect(int doc) > > With a default "false" return code. If a collector returns "true" the > caller > > may stop collecting. So all normal collectors would simply return > "false". > > This could introduce some performance overhead of adding a return value > to > > the call stack, and some checking in the calling code. > > However, for some other use cases, like > > > > usually the trick here to stop collecting is to throw a > runtimeexception (your own subclass that you can catch), like > timelimitingcollector. > > -- > lucidimagination.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Anne Veling BeyondTrees.com +31 6 50 969 170 @anneveling
