diff --git a/lucene/suggest/src/test/org/apache/lucene/search/suggest/LookupBenchmarkTest.java b/lucene/suggest/src/test/org/apache/lucene/search/suggest/LookupBenchmarkTest.java index 8ff64a2392b..a0b327849c5 100644 --- a/lucene/suggest/src/test/org/apache/lucene/search/suggest/LookupBenchmarkTest.java +++ b/lucene/suggest/src/test/org/apache/lucene/search/suggest/LookupBenchmarkTest.java @@ -36,11 +36,14 @@ import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.analysis.MockTokenizer; import org.apache.lucene.search.suggest.analyzing.AnalyzingInfixSuggester; import org.apache.lucene.search.suggest.analyzing.AnalyzingSuggester; +import org.apache.lucene.search.suggest.analyzing.BlendedInfixSuggester; +import org.apache.lucene.search.suggest.analyzing.FreeTextSuggester; import org.apache.lucene.search.suggest.analyzing.FuzzySuggester; import org.apache.lucene.search.suggest.fst.FSTCompletionLookup; import org.apache.lucene.search.suggest.fst.WFSTCompletionLookup; import org.apache.lucene.search.suggest.jaspell.JaspellLookup; import org.apache.lucene.search.suggest.tst.TSTLookup; +import org.apache.lucene.store.Directory; import org.apache.lucene.store.FSDirectory; import org.apache.lucene.util.*; import org.junit.BeforeClass; @@ -59,7 +62,9 @@ public class LookupBenchmarkTest extends LuceneTestCase { JaspellLookup.class, TSTLookup.class, FSTCompletionLookup.class, - WFSTCompletionLookup.class + WFSTCompletionLookup.class, + BlendedInfixSuggester.class, + FreeTextSuggester.class ); private final static int rounds = 15; @@ -162,8 +167,9 @@ public class LookupBenchmarkTest extends LuceneTestCase { lookup = cls.newInstance(); } catch (InstantiationException e) { Analyzer a = new MockAnalyzer(random, MockTokenizer.KEYWORD, false); - if (cls == AnalyzingInfixSuggester.class) { - lookup = new AnalyzingInfixSuggester(FSDirectory.open(createTempDir("LookupBenchmarkTest")), a); + if (cls == AnalyzingInfixSuggester.class || cls == BlendedInfixSuggester.class) { + Constructor ctor = cls.getConstructor(Directory.class, Analyzer.class); + lookup = ctor.newInstance(FSDirectory.open(createTempDir("LookupBenchmarkTest")), a); } else { Constructor ctor = cls.getConstructor(Analyzer.class); lookup = ctor.newInstance(a);