Renaming method according to review comments

This commit is contained in:
Christoph Büscher 2016-08-10 18:03:39 +02:00
parent 9c91ced029
commit d11521318d
3 changed files with 3 additions and 3 deletions

View File

@ -137,7 +137,7 @@ public class DirectSpellcheckerSettings {
this.minDocFreq = minDocFreq;
}
public DirectSpellChecker getDirectSpellChecker() {
public DirectSpellChecker createDirectSpellChecker() {
DirectSpellChecker directSpellChecker = new DirectSpellChecker();
directSpellChecker.setAccuracy(accuracy());

View File

@ -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(),

View File

@ -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()