You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Hoss Man (JIRA)" <ji...@apache.org> on 2018/07/23 17:53:00 UTC

[jira] [Commented] (LUCENE-8421) TopScoreDocCollector.create(int) should disable exact hit counts

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

Hoss Man commented on LUCENE-8421:
----------------------------------

-0

This seem like a scary default behavior – particularly since {{TopDocs.totalHits}} is still going to be there in the response object containing non-deterministic data (IIUC the docs make no garuntees unless {{trackTotalHits=true}} – so it's not like we even have a "-1" sentinal value, and it's not a method that we could make throw an UnsupportedOperationException if the original collector had {{trackTotalHits=false}} ) ... and especially since existing users who already have code that calls {{TopScoreDocCollector.create(42)}} won't see any sort of compilation error on upgrade – their code will just starrt lying to them about hte number of total hits.

couldn't we at least use a new static method name, and deprecate the old single arg {{create(int)}} ??  that way nothing will change out from under people.

> TopScoreDocCollector.create(int) should disable exact hit counts
> ----------------------------------------------------------------
>
>                 Key: LUCENE-8421
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8421
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Adrien Grand
>            Priority: Minor
>         Attachments: LUCENE-8421.patch
>
>
> We should make TopScoreDocCollector.create(int) disable exact hit counts so that users don't have to opt out to get faster queries. Users can still get exact counts by using the other factory method TopScoreDocCollector.create(int,ScoreDoc,boolean).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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