Renaming method according to review comments
This commit is contained in:
parent
9c91ced029
commit
d11521318d
|
@ -137,7 +137,7 @@ public class DirectSpellcheckerSettings {
|
|||
this.minDocFreq = minDocFreq;
|
||||
}
|
||||
|
||||
public DirectSpellChecker getDirectSpellChecker() {
|
||||
public DirectSpellChecker createDirectSpellChecker() {
|
||||
|
||||
DirectSpellChecker directSpellChecker = new DirectSpellChecker();
|
||||
directSpellChecker.setAccuracy(accuracy());
|
||||
|
|
|
@ -83,7 +83,7 @@ public final class PhraseSuggester extends Suggester<PhraseSuggestionContext> {
|
|||
final List<CandidateGenerator> gens = new ArrayList<>(generators.size());
|
||||
for (int i = 0; i < numGenerators; i++) {
|
||||
PhraseSuggestionContext.DirectCandidateGenerator generator = generators.get(i);
|
||||
DirectSpellChecker directSpellChecker = generator.getDirectSpellChecker();
|
||||
DirectSpellChecker directSpellChecker = generator.createDirectSpellChecker();
|
||||
Terms terms = MultiFields.getTerms(indexReader, generator.field());
|
||||
if (terms != null) {
|
||||
gens.add(new DirectCandidateGenerator(directSpellChecker, generator.field(), generator.suggestMode(),
|
||||
|
|
|
@ -48,7 +48,7 @@ public final class TermSuggester extends Suggester<TermSuggestionContext> {
|
|||
@Override
|
||||
public TermSuggestion innerExecute(String name, TermSuggestionContext suggestion, IndexSearcher searcher, CharsRefBuilder spare)
|
||||
throws IOException {
|
||||
DirectSpellChecker directSpellChecker = suggestion.getDirectSpellCheckerSettings().getDirectSpellChecker();
|
||||
DirectSpellChecker directSpellChecker = suggestion.getDirectSpellCheckerSettings().createDirectSpellChecker();
|
||||
final IndexReader indexReader = searcher.getIndexReader();
|
||||
TermSuggestion response = new TermSuggestion(
|
||||
name, suggestion.getSize(), suggestion.getDirectSpellCheckerSettings().sort()
|
||||
|
|
Loading…
Reference in New Issue