mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
open_index was returning an index instead of a SpellChecker. #15
This commit is contained in:
parent
0a893be01d
commit
0b5eba6620
1 changed files with 3 additions and 1 deletions
|
@ -70,7 +70,9 @@ def open_index(directory=None, session=None, recreate=False):
|
||||||
# Already exists; should be an index!
|
# Already exists; should be an index!
|
||||||
try:
|
try:
|
||||||
index = whoosh.index.open_dir(directory, indexname='pokedex')
|
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
|
return index, speller
|
||||||
except whoosh.index.EmptyIndexError as e:
|
except whoosh.index.EmptyIndexError as e:
|
||||||
# Apparently not a real index. Fall out of the if and create it
|
# Apparently not a real index. Fall out of the if and create it
|
||||||
|
|
Loading…
Reference in a new issue