You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Doron Cohen (JIRA)" <ji...@apache.org> on 2008/08/13 16:34:44 UTC

[jira] Commented: (LUCENE-1356) Allow easy extensions of TopDocCollector

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

Doron Cohen commented on LUCENE-1356:
-------------------------------------

Shai, Thanks for creating this issue and patch!

I noticed you also modified the private reusableSD to be protected.

This field is just for avoiding creating a new object at each insert to the priority queue. 
Note that TopFieldDocCollector maintains its own reusable object for this matter, and it of a 'slightly' different type.

I am wondering if the right thing to do is to (1) leave that field private, or (2) make it protected but then make TopFieldDocCollector  use it too.
I'm inclined for option 1.

What do you think? Others?

> Allow easy extensions of TopDocCollector
> ----------------------------------------
>
>                 Key: LUCENE-1356
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1356
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>            Reporter: Shai Erera
>            Assignee: Doron Cohen
>            Priority: Minor
>         Attachments: 1356.patch
>
>
> TopDocCollector's members and constructor are declared either private or package visible. It makes it hard to extend it as if you want to extend it you can reuse its *hq* and *totatlHits* members, but need to define your own. It also forces you to override getTotalHits() and topDocs().
> By changing its members and constructor (the one that accepts a PQ) to protected, we allow users to extend it in order to get a different view of 'top docs' (like TopFieldCollector does), but still enjoy its getTotalHits() and topDocs() method implementations.

-- 
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: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org