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

Mark Harwood commented on LUCENE-6066:
--------------------------------------

bq. maybe we should have this feature in lucene/sandbox or in lucene/misc first 
instead of lucene/core?

It relies on a change to core's PriorityQueue (which was the original focus of 
this issue but then the issue extended into being about the specialized 
collector that is possibly the only justification for introducing a "remove" 
method on PQ).

bq. I think we should also add a lucene.experimental annotation to this 
collector?

That seems fair. 

bq. the `if (size == 0)` condition at the top of PQ.remove looks already 
covered by the below for-loop?

good point, will change.

bq. Should PQ.downHeap and upHead delegate to their counterpart that takes a 
position?

I wanted to avoid the possibility of introducing any slow down to the PQ impl 
by keeping the existing upHeap/downHeap methods intact and duplicating most of 
their logic in the version that takes a position.


> Collector that manages diversity in search results
> --------------------------------------------------
>
>                 Key: LUCENE-6066
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6066
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/query/scoring
>            Reporter: Mark Harwood
>            Priority: Minor
>             Fix For: 5.0
>
>         Attachments: LUCENE-PQRemoveV8.patch
>
>
> This issue provides a new collector for situations where a client doesn't 
> want more than N matches for any given key (e.g. no more than 5 products from 
> any one retailer in a marketplace). In these circumstances a document that 
> was previously thought of as competitive during collection has to be removed 
> from the final PQ and replaced with another doc (eg a retailer who already 
> has 5 matches in the PQ receives a 6th match which is better than his 
> previous ones). This requires a new remove method on the existing 
> PriorityQueue class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to