msfroh commented on PR #15469:
URL: https://github.com/apache/lucene/pull/15469#issuecomment-3747016657

   The "existing" behavior (where some stuff is delegated but others are not) 
does (I think) a *pretty good* job of satisfying functional correctness while 
missing out on potential optimizations. The `FilterWeight#count()` case is also 
like that -- by not delegating, we just return `-1`, which forces us to compute 
the count the long way, even if the delegate could do it quickly.
   
   It's still super trappy in terms of knowing what gets delegated and what 
doesn't, though. 
   
   Another pair of methods whose behavior depend on each other: 
`Weight#scorerSupplier()` and `Weight#matches()` are expected to be 
semantically the same. A `FilterWeight` that skips some documents from the 
wrapped `scorerSupplier` would need to either override `matches` to drop the 
same documents or would need to delegate to `Weight#matches`, which uses the 
`scorerSupplier` directly. In this case, we do delegate both methods but don't 
have a test that covers the case where only one is overridden.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to