Commit 22bb357f authored by Michal Čihař's avatar Michal Čihař

Simplify code by using Whoosh wrapper

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 4feac573
......@@ -118,9 +118,7 @@ def get_source_index():
create_source_index()
index = STORAGE.open_index('source')
if 'location' not in index.schema:
writer = index.writer()
writer.add_field('location', TEXT)
writer.commit()
index.add_field('location', TEXT)
return index
......@@ -133,9 +131,7 @@ def get_target_index(lang):
create_target_index(lang)
index = STORAGE.open_index(name)
if 'comment' not in index.schema:
writer = index.writer()
writer.add_field('comment', TEXT)
writer.commit()
index.add_field('comment', TEXT)
return index
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment