public UmbracoSpellChecker(BaseLuceneSearcher searchProvider)
        {
            var searcher = (IndexSearcher)searchProvider.GetSearcher();

            _indexReader = searcher.GetIndexReader();
            _checker     = new SpellChecker.Net.Search.Spell.SpellChecker(new RAMDirectory(), new JaroWinklerDistance());
        }
        public AlternateSpellingTool(BaseLuceneSearcher SearchProvider)
        {
            this._searchProvider = SearchProvider;
            var searcher = (IndexSearcher)SearchProvider.GetSearcher();

            indexReader    = searcher.GetIndexReader();
            _luceneChecker = new SpellChecker(new RAMDirectory(), new JaroWinklerDistance());
        }
        private static IndexReader GetIndexReaderForSearcher(this BaseLuceneSearcher searcher)
        {
            var indexSearcher = searcher.GetSearcher() as IndexSearcher;

            if (indexSearcher == null)
            {
                throw new InvalidOperationException("The index searcher is not of type " + typeof(IndexSearcher) + " cannot execute this method");
            }
            return(indexSearcher.GetIndexReader());
        }