jpountz commented on PR #13542:
URL: https://github.com/apache/lucene/pull/13542#issuecomment-2212586823

   Thanks for looking into this!
   
   > IndexSearcher#count / TotalHitCountCollector rely on 
Weight#count(LeafReaderContext), which now gets called multiple times against 
the same leaf and leads to excessive counting of hits.
   Resolved by synchronizing the call to getLeafCollector, to make sure we 
don't pull a leaf collector for the same segment multiple times in parallel
   
   I wonder if it should be on `IndexSearcher` to not call 
`Collector#getLeafCollector` multiple times if the first call throws a 
`CollectionTerminatedException` (what you implemented) or if it should be on 
the `CollectorManager` to no longer assume that `Collector#getLeafCollector` 
gets called exactly once per leaf. The latter feels cleaner to me conceptually, 
and I believe that it would also avoid the issue that you had with 
`LRUQueryCache`? The downside is that we'll need to fix all collectors that 
make this assumption.


-- 
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