lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shai Erera (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-2542) TopDocsCollector should be abstract super class that is the real "TopDocsCollector" contract, a subclass should implement the priority-queue logic. e.g. PQTopDocsCollector
Date Tue, 20 Jul 2010 12:05:49 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-2542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12890246#action_12890246
] 

Shai Erera commented on LUCENE-2542:
------------------------------------

Can you please add the TDC impl to JustCompileSearch (instead of the testcase you wrote)?
Look at other internal classes there for an example. This class is not a test per se, however
it's there to ensure certain extensions are possible.

Also, can you change the jdoc from "Most extending classes ..." to "Extending classes can
override any of the methods to provide their own implementation, as well as avoid the use
of the priority queue entirely by passing null to {@link #TopDocsCollector(PriorityQueue)}.
In that case however, you might want to consider overriding all methods, in order to avoid
an NullPointerException.

Then, you can remove the jdoc of the ctor.

> TopDocsCollector should be abstract super class that is the real "TopDocsCollector" contract,
a subclass should implement the priority-queue logic. e.g. PQTopDocsCollector
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-2542
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2542
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Search
>    Affects Versions: 3.0.2
>            Reporter: Woody Anderson
>             Fix For: 4.0
>
>         Attachments: LUCENE-2542.patch, LUCENE-2542.patch, LUCENE_3.0.2-2542.patch
>
>
> TopDocsCollector is both an abstract interface for producing TopDocs as well as a PriorityQueue
based implementation.
> Not all Collectors that could produce TopDocs must use a PriorityQueue, and it would
be advantageous to allow the TopDocsCollector to be an "interface" type abstract class, with
a PQTopDocsCollector sub-class.
> While doing this, it'd be good to clean up the generics uses in these classes. As it's
odd to create a TopFieldCollector and have to case the TopDocs object, when this can be fixed
with generics.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message