made simple search suck less

This commit is contained in:
Matthew Scragg 2014-11-12 22:11:13 -06:00
parent fe8565327d
commit b757ceff57
3 changed files with 4 additions and 3 deletions

View file

@ -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

View file

@ -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 %}

View file

@ -1 +1 @@
__version__ = '0.5.0'
__version__ = '0.5.1'