From 0b5eba6620dbcff5971123e87cc12c10f5b4fc39 Mon Sep 17 00:00:00 2001 From: Eevee Date: Thu, 20 Aug 2009 21:07:06 -0700 Subject: [PATCH] open_index was returning an index instead of a SpellChecker. #15 --- pokedex/lookup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pokedex/lookup.py b/pokedex/lookup.py index f17caf7..5643f66 100644 --- a/pokedex/lookup.py +++ b/pokedex/lookup.py @@ -70,7 +70,9 @@ def open_index(directory=None, session=None, recreate=False): # Already exists; should be an index! try: index = whoosh.index.open_dir(directory, indexname='pokedex') - speller = whoosh.index.open_dir(directory, indexname='spelling') + spell_store = whoosh.filedb.filestore.FileStorage(directory) + speller = whoosh.spelling.SpellChecker(spell_store, + indexname='spelling') return index, speller except whoosh.index.EmptyIndexError as e: # Apparently not a real index. Fall out of the if and create it