Browse files

Optomized search results so that they don't have to hit the DB.

  • Loading branch information...
1 parent 6ad5c64 commit 8b182efce10c77b25b863740c7fe83b9dcfcef6d @jacobian jacobian committed Feb 2, 2011
Showing with 2 additions and 1 deletion.
  1. +1 −1 django_website/docs/templates/docs/search.html
  2. +1 −0 django_website/docs/views.py
View
2 django_website/docs/templates/docs/search.html
@@ -26,7 +26,7 @@
<div id="search-results">
{% for result in page.object_list %}
<h3>
- <a href="{{ result.object.get_absolute_url }}">{{ result.object.title }}</a>
+ <a href="{% url document-detail lang=result.lang version=result.version url=result.path %}">{{ result.title }}</a>
</h3>
<p>{% highlight result.text with query max_length 200 %}</p>
{% empty %}
View
1 django_website/docs/views.py
@@ -67,6 +67,7 @@ def __init__(self, **kwargs):
kwargs.update({
'template': 'docs/search.html',
'form_class': DocSearchForm,
+ 'load_all': False,
})
super(DocSearchView, self).__init__(**kwargs)

0 comments on commit 8b182ef

Please sign in to comment.