lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shikhar Bhushan (JIRA)" <>
Subject [jira] [Commented] (LUCENE-4370) Let Collector know when all docs have been collected
Date Fri, 16 May 2014 11:20:39 GMT


Shikhar Bhushan commented on LUCENE-4370:

Been thinking about the semantics of these done callbacks not being invoked in case of exceptions
which was a concern raised by [~jpountz] in LUCENE-5527, this seems to be not very helpful
when e.g. you have a TimeExceededException or EarlyTerminatingCollectorException thrown and
you need to maybe merge in some state into the parent collector in {{LeafCollector.leafDone()}},
or perhaps finalize results in {{Collector.done()}}.

Maybe we need a special kind of exception, just like CollectionTerminatedException. The semantics
for CollectionTerminatedException are currently that collection continues with the next leaf.
So some new base-class for the "rethrow me but invoke done callbacks" case?

In case of any other kinds of exception like IOException, I don't think we should be invoking
done() callbacks because the collector's results should not be expected to be usable.

> Let Collector know when all docs have been collected
> ----------------------------------------------------
>                 Key: LUCENE-4370
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/search
>    Affects Versions: 4.0-BETA
>            Reporter: Tomás Fernández Löbbe
>            Priority: Minor
>         Attachments: LUCENE-4370.patch, LUCENE-4370.patch
> Collectors are a good point for extension/customization of Lucene/Solr, however sometimes
it's necessary to know when the last document has been collected (for example, for flushing
cached data).
> It would be nice to have a method that gets called after the last doc has been collected.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message