sgup432 commented on issue #15887:
URL: https://github.com/apache/lucene/issues/15887#issuecomment-4331395384

   >is the idea that the clauses are zero-cost on most segments, but low-cost 
on some segments?
   
   Yeah that case and even for no match at all.
   
   >If the term queries don't match at all on the index, I would maybe have 
expected them to get turned into MatchNoDocsQuery
   
   Good point. But I don't see 
[term](https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/search/TermQuery.java)
 query having its `rewrite()` method, it basically reuses the parent method 
which just returns the same query. Kinda weird, can u cross check and keep me 
sane here?
   
   
   In that case, below are the scenarios and corresponding approach I can think 
of:
   - For cases where clauses are zero-cost on most segments, but >0 on few, we 
need to handle at opt() layer to skip scorer construction for that segment.
   - For cases term is absent from entire index, we need to handle that at 
`rewrite()` level
   


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