Improve SimpleSearch with subdirs

This commit is contained in:
Chase Sterling 2015-12-10 00:27:43 -05:00
parent 6d62d6b8b4
commit 57067a9f95

View file

@ -40,7 +40,7 @@ class SimpleSearch(BaseSearch):
res = [] res = []
for entry in g.current_wiki.get_index(): for entry in g.current_wiki.get_index():
name = filename_to_cname(entry['name']) name = filename_to_cname(entry['name'])
if set(query.split()).intersection(name.split('-')): if set(query.split()).intersection(name.replace('/', '-').split('-')):
page = g.current_wiki.get_page(name) page = g.current_wiki.get_page(name)
res.append(dict(name=name, content=page['data'])) res.append(dict(name=name, content=page['data']))
return res return res