diff --git a/src/accounts/templates/search/indexes/accounts/user_text.txt b/src/accounts/templates/search/indexes/accounts/user_text.txt index ee0dcb3..35b480f 100644 --- a/src/accounts/templates/search/indexes/accounts/user_text.txt +++ b/src/accounts/templates/search/indexes/accounts/user_text.txt @@ -1,9 +1,7 @@ {{ object.username }} {{ object.get_full_name }} -{{ object.email }} +{{ object.get_full_name|slugify }} {{ object.institution }} +{{ object.institution|slugify }} {{ object.role }} -{{ object.twitter }} -{{ object.facebook }} -{{ object.google_talk }} -{{ object.webpage }} +{{ object.role|slugify }} diff --git a/src/proxy/templates/search/indexes/proxy/revision_text.txt b/src/proxy/templates/search/indexes/proxy/revision_text.txt index 1d87ec5..b5e6bd9 100644 --- a/src/proxy/templates/search/indexes/proxy/revision_text.txt +++ b/src/proxy/templates/search/indexes/proxy/revision_text.txt @@ -1,4 +1,8 @@ {{ object.repository_name }} +{{ object.repository_name|slugify }} {{ object.revision }} +{{ object.revision|slugify }} {% firstof object.get_author.get_full_name object.author %} +{% firstof object.get_author.get_full_name|slugify object.author|slugify %} {{ object.message }} +{{ object.message|slugify }} diff --git a/src/proxy/templates/search/indexes/proxy/ticket_text.txt b/src/proxy/templates/search/indexes/proxy/ticket_text.txt index 2063a17..93d199e 100644 --- a/src/proxy/templates/search/indexes/proxy/ticket_text.txt +++ b/src/proxy/templates/search/indexes/proxy/ticket_text.txt @@ -1,11 +1,20 @@ {{ object.summary }} +{{ object.summary|slugify }} {{ object.description }} +{{ object.description|slugify }} {{ object.milestone }} -{{ object.component }} +{{ object.milestone|slugify }} +{{ object.component|slugify }} {{ object.version }} {{ object.severity }} +{{ object.severity|slugify }} {{ object.reporter }} +{{ object.reporter|slugify }} {% firstof object.get_author.get_fullname or object.author %} +{% firstof object.get_author.get_fullname|slugify or object.author|slugify %} {{ object.status }} +{{ object.status|slugify }} {{ object.keywords }} +{{ object.keywords|slugify }} {{ object.collaborators }} +{{ object.collaborators|slugify }} diff --git a/src/proxy/templates/search/indexes/proxy/wiki_text.txt b/src/proxy/templates/search/indexes/proxy/wiki_text.txt index 7e7ef46..eba4907 100644 --- a/src/proxy/templates/search/indexes/proxy/wiki_text.txt +++ b/src/proxy/templates/search/indexes/proxy/wiki_text.txt @@ -1,3 +1,8 @@ +{{ object.author }} +{{ object.author|slugify }} {{ object.name }} -{{ object.get_collaborators }} -{{ object.text }} +{{ object.name|slugify }} +{{ object.collaborators }} +{{ object.collaborators|slugify }} +{{ object.wiki_text }} +{{ object.wiki_text|slugify }} diff --git a/src/search/forms.py b/src/search/forms.py index ce166c0..2df482d 100644 --- a/src/search/forms.py +++ b/src/search/forms.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- +import unicodedata + from django import forms from django.utils.translation import ugettext_lazy as _ from haystack.forms import SearchForm @@ -17,7 +19,10 @@ class ColabSearchForm(SearchForm): return self.no_query_found() if self.cleaned_data.get('q'): - sqs = self.searchqueryset.auto_query(self.cleaned_data['q']) + q = unicodedata.normalize( + 'NFKD', unicode(self.cleaned_data.get('q')) + ).encode('ascii', 'ignore') + sqs = self.searchqueryset.auto_query(q) else: sqs = self.searchqueryset.all() @@ -35,8 +40,6 @@ class ColabSearchForm(SearchForm): # sqs = self.searchqueryset.models(Ticket) # else: # sqs = self.searchqueryset.all() - else: - sqs = self.searchqueryset.models(User, Message) if self.load_all: diff --git a/src/super_archives/templates/search/indexes/super_archives/message_text.txt b/src/super_archives/templates/search/indexes/super_archives/message_text.txt index 802cb7a..cafa5a6 100644 --- a/src/super_archives/templates/search/indexes/super_archives/message_text.txt +++ b/src/super_archives/templates/search/indexes/super_archives/message_text.txt @@ -1,6 +1,10 @@ {{ object.thread.mailinglist.name }} +{{ object.thread.mailinglist.name|slugify }} {{ object.thread.subject_token }} + {{ object.body }} +{{ object.body|slugify }} {{ object.subject_clean }} -{{ object.url }} -{{ object.received_time }} +{{ object.subject_clean|slugify }} + +{{ object.from_address.get_full_name }} -- libgit2 0.21.2