You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/09/01 09:38:05 UTC
[GitHub] [lucene] jpountz commented on pull request #242: LUCENE-9620 Add Weight#count(LeafReaderContext)
jpountz commented on pull request #242:
URL: https://github.com/apache/lucene/pull/242#issuecomment-909123525
> Does it make sense to have a count API return -1 as the result if the number of matches are greater than a threshold?
> Also, in an unoptimized query with > TOTAL_HITS_THRESHOLD hits, we will count the results twice because we first count it in the count API (with the weight.count call) and then again with the leafCollector from the new totalHitCountCollector we create in the class?
This is why I suggested always returning -1 if the count cannot be returned in constant-time. This way we ensure that we would never linearly scan all matches twice for the purpose of counting hits.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org