romseygeek commented on code in PR #16058:
URL: https://github.com/apache/lucene/pull/16058#discussion_r3232825295
##########
lucene/suggest/src/java/org/apache/lucene/search/suggest/document/CompletionQuery.java:
##########
@@ -89,11 +89,7 @@ public Query rewrite(IndexSearcher indexSearcher) throws
IOException {
Terms terms;
for (LeafReaderContext context : indexSearcher.getLeafContexts()) {
LeafReader leafReader = context.reader();
- try {
- if ((terms = leafReader.terms(getField())) == null) {
- continue;
- }
- } catch (IOException _) {
+ if ((terms = leafReader.terms(getField())) == null) {
Review Comment:
❤️
##########
lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextFieldsReader.java:
##########
@@ -808,14 +809,18 @@ public Iterator<String> iterator() {
private final Map<String, SimpleTextTerms> termsCache = new HashMap<>();
@Override
- public synchronized Terms terms(String field) throws IOException {
+ public synchronized Terms terms(String field) {
SimpleTextTerms terms = termsCache.get(field);
if (terms == null) {
Long fp = fields.get(field);
if (fp == null) {
return null;
} else {
- terms = new SimpleTextTerms(field, fp, maxDoc);
+ try {
+ terms = new SimpleTextTerms(field, fp, maxDoc);
+ } catch (IOException e) {
+ throw new UncheckedIOException(e);
+ }
Review Comment:
Yeah this is a pain but I agree not worth reworking SimpleText to store the
metadata in the header immediately. Maybe add it as a TODO and it can be a
nice starter project for somebody who wants to learn more about Codec
implementations?
--
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]