indexer.index(addC);
indexer.index(addB);
indexer.index(addA);
Execute.sleep(8000);
FSDirectory origDir = FSDirectory.getDirectory(tmpDir + File.separator + "indexer" + File.separator + "indexes" + File.separator + "index");
FSDirectory spellDir = FSDirectory.getDirectory(tmpDir + File.separator + "spell");
new DidYouMeanIndexer().createSpellIndex("content".intern(), origDir, spellDir);
WordQuerySuggestor suggestor = new WordQuerySuggestor(spellDir.getFile());
assertNotNull(suggestor.suggest(new LazyParsedQuery("content")));
assertNotNull(suggestor.suggest(new LazyParsedQuery("contenta")));
assertNotNull(suggestor.suggest(new LazyParsedQuery("contetb")));
Config searcherConfig = Config.getConfig("searcher.properties");
searcherConfig.set("compositeSearcher.useSpellCheckSuggestQuery", "true");
searcherConfig.set("searcher.suggestQuerySearcher.dictionaryDir", spellDir.getFile().getAbsolutePath());
searcher = new CompositeSearcher();
GroupedSearchResults res = searcher.search(new LazyParsedQuery("contentb"), 0, 10, null, 20, null, null);
assertEquals(1, res.totalGroupsEstimation());
res = searcher.search(new LazyParsedQuery("content"), 0, 10, null, 20, null, null);