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

Shai Erera commented on LUCENE-5232:
------------------------------------

Well, maybe start with why computing maxScore at all, even for a 
TopScoreDocCollector? We use that to normalize document scores when doing some 
form of distributed search. When you use TSDC, it's easy to fill 
TopDocs.maxScore, because it's already known. When you sort by a field, you 
have to score *every* document in order to fill maxScore, as Mike pointed out, 
and not just those that make it into the heap based on their sort value.

I think the problematic API here might be TopFieldDocs extending TopDocs. I 
believe that when you ask to sort, you don't need scores. That's the common 
case. So if we e.g. returned a TopFieldDocs which does not extend from TopDocs, 
and FieldDoc only gave you the sort-by values + 'doc', then we can remove 
doScore + doMaxScore entirely from TopFieldCollector. Let the users that need 
to know the score in addition to the sort-by values write a custom Collector. 
Or, they can put a SortField.SCORE as the last sort-by field, and they get the 
scores already in FieldDoc.fields.
                
> Remove doMaxScore from indexsearcher, collector specializations, etc
> --------------------------------------------------------------------
>
>                 Key: LUCENE-5232
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5232
>             Project: Lucene - Core
>          Issue Type: Sub-task
>            Reporter: Robert Muir
>             Fix For: 5.0
>
>
> I think we should just compute doMaxScore whenever doDocScores = true.
> This would remove 4 collector specializations and remove a boolean parameter 
> from 4 indexsearcher methods.
> We can just do this in 5.0 I think.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to