lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shai Erera (JIRA)" <>
Subject [jira] Commented: (LUCENE-1356) Allow easy extensions of TopDocCollector
Date Thu, 14 Aug 2008 05:23:44 GMT


Shai Erera commented on LUCENE-1356:

IMO, TopFieldDocCollector should be changed to use reusableSD. FieldDoc extends ScoreDoc.
That's the reason I modified it to protected - for extensions of TopDocCollector who maintain
in PQ ScoreDoc types (either ScoreDoc or extensions).
I don't see any advantage in marking it private, nor any disadvantage if any extension to
TopDocCollector will maintain its own ScoreDoc instance.
It's just that we have TopDocCollector, TopFieldDocCollector and my extension to TDC which
insert ScoreDoc instances into PQ, so it made sense to me to change it to protected.

> Allow easy extensions of TopDocCollector
> ----------------------------------------
>                 Key: LUCENE-1356
>                 URL:
>             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:
For additional commands, e-mail:

View raw message