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-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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

Reply via email to