Skip to content

Commit

Permalink
fix: update for migrating lucene 8.11.3
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Miura <[email protected]>
  • Loading branch information
miurahr committed Aug 6, 2024
1 parent 7a07955 commit dc932e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
*/
package org.languagetool.dev;

import org.apache.lucene.index.Fields;
import org.apache.lucene.index.MultiFields;
import org.apache.lucene.index.MultiTerms;
import org.apache.lucene.index.Terms;
import org.apache.lucene.index.TermsEnum;
import org.apache.lucene.util.BytesRef;
Expand Down Expand Up @@ -112,8 +111,7 @@ private void dumpOccurrences(Set<String> tokens) throws IOException {

private TermsEnum getIterator() throws IOException {
LuceneSearcher luceneSearcher = getLuceneSearcher(3);
Fields fields = MultiFields.getFields(luceneSearcher.getReader());
Terms terms = fields.terms("ngram");
Terms terms = MultiTerms.getTerms(luceneSearcher.getReader(), "ngram");
return terms.iterator();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public SearcherResult findRuleMatchesOnIndex(PatternRule rule, Language language
}

private PossiblyLimitedTopDocs getTopDocs(Query query) throws IOException {
TopScoreDocCollector topCollector = TopScoreDocCollector.create(maxHits);
TopScoreDocCollector topCollector = TopScoreDocCollector.create(maxHits, Integer.MAX_VALUE);
Counter clock = Counter.newCounter(true);
int waitMillis = 1000;
// TODO: if we interrupt the whole thread anyway, do we still need the TimeLimitingCollector?
Expand Down

0 comments on commit dc932e8

Please sign in to comment.