This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push: new 1a7c50d Camel-Catalog-lucene: Removed deprecated class usages 1a7c50d is described below commit 1a7c50d4d82184a4c4f13aefcaaac4eea675b458 Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Mon Mar 2 12:18:55 2020 +0100 Camel-Catalog-lucene: Removed deprecated class usages --- .../org/apache/camel/catalog/lucene/LuceneSuggestionStrategy.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/catalog/camel-catalog-lucene/src/main/java/org/apache/camel/catalog/lucene/LuceneSuggestionStrategy.java b/catalog/camel-catalog-lucene/src/main/java/org/apache/camel/catalog/lucene/LuceneSuggestionStrategy.java index 277ea1e..f88beec 100644 --- a/catalog/camel-catalog-lucene/src/main/java/org/apache/camel/catalog/lucene/LuceneSuggestionStrategy.java +++ b/catalog/camel-catalog-lucene/src/main/java/org/apache/camel/catalog/lucene/LuceneSuggestionStrategy.java @@ -24,6 +24,7 @@ import org.apache.lucene.analysis.core.KeywordAnalyzer; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.search.spell.PlainTextDictionary; import org.apache.lucene.search.spell.SpellChecker; +import org.apache.lucene.store.ByteBuffersDirectory; import org.apache.lucene.store.RAMDirectory; /** @@ -34,6 +35,7 @@ import org.apache.lucene.store.RAMDirectory; public class LuceneSuggestionStrategy implements SuggestionStrategy { private int maxSuggestions = 3; + private SpellChecker checker; @Override public String[] suggestEndpointOptions(Set<String> names, String unknownOption) { @@ -49,8 +51,8 @@ public class LuceneSuggestionStrategy implements SuggestionStrategy { PlainTextDictionary words = new PlainTextDictionary(reader); // use in-memory lucene spell checker to make the suggestions - RAMDirectory dir = new RAMDirectory(); - SpellChecker checker = new SpellChecker(dir); + ByteBuffersDirectory dir = new ByteBuffersDirectory(); + checker = new SpellChecker(dir); checker.indexDictionary(words, new IndexWriterConfig(new KeywordAnalyzer()), false); return checker.suggestSimilar(unknownOption, maxSuggestions);