You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "iverase (via GitHub)" <gi...@apache.org> on 2026/08/18 07:34:45 UTC

[I] Should ScoreSupplier#cost API throw an IOException? [lucene]

iverase opened a new issue, #16518:
URL: https://github.com/apache/lucene/issues/16518

   I was reviewing the implementation of that method and I noticed that in most cases we need to perform IO to compute the value. In some cases, we need to catch the IOException and throw and UncheckedIOException instead (see [TermQuery](https://github.com/apache/lucene/blob/fa0e704d2a0f941f2bbca17184472ae0e2b3743e/lucene/core/src/java/org/apache/lucene/search/TermQuery.java#L180)) or in some cases the IO has already been performed somewhere else (see [DefaultScorerSupplier](https://github.com/apache/lucene/blob/378ca8d1bbf36a9b57c1c8cd6ac1703f005c4cfe/lucene/core/src/java/org/apache/lucene/search/Weight.java#L207) where the scorer has already being built). 
   
   
   Therefore throwing an IOException in this method provides better information to the user and it makes the code a bit cleaner. The idea would be changing this method signature for lucene 11.


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


Re: [I] Should ScoreSupplier#cost API throw an IOException? [lucene]

Posted by "iverase (via GitHub)" <gi...@apache.org>.
iverase closed issue #16518: Should ScoreSupplier#cost API throw an IOException?
URL: https://github.com/apache/lucene/issues/16518


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