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