made simple search suck less
This commit is contained in:
parent
fe8565327d
commit
b757ceff57
|
@ -33,7 +33,7 @@ class SimpleSearch(BaseSearch):
|
|||
res = []
|
||||
for entry in g.current_wiki.get_index():
|
||||
name = filename_to_cname(entry['name'])
|
||||
if query in name.split('-'):
|
||||
if set(query.split()).intersection(name.split('-')):
|
||||
page = g.current_wiki.get_page(name)
|
||||
res.append(dict(name=name, content=page['data']))
|
||||
return res
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% block body %}
|
||||
{% if results %}
|
||||
<h3>Results for <em class="text-info">{{ request.args.get('q') }}</em></h3>
|
||||
<div class="list-group">
|
||||
{% for r in results %}
|
||||
<a href="{{ url_for('wiki.page', name=r['name']) }}" class="list-group-item">
|
||||
|
@ -12,6 +13,6 @@
|
|||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
No Results Found
|
||||
<h3>No results found for <em class="text-info">{{ request.args.get('q') }}</em></h3>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -1 +1 @@
|
|||
__version__ = '0.5.0'
|
||||
__version__ = '0.5.1'
|
Loading…
Reference in a new issue