From d7649b3a66d89ce9075b30a1ca41e3b8deb1a012 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Wed, 23 Dec 2015 22:03:09 +0100 Subject: [PATCH] Use plainto_tsquery instead of to_tsquery to allow multiple words --- umap/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/umap/views.py b/umap/views.py index 9a634b81..6aacf319 100644 --- a/umap/views.py +++ b/umap/views.py @@ -141,7 +141,7 @@ class Search(TemplateView, PaginatorMixin): q = self.request.GET.get('q') results = [] if q: - where = "to_tsvector(name) @@ to_tsquery(%s)" + where = "to_tsvector(name) @@ plainto_tsquery(%s)" if getattr(settings, 'UMAP_USE_UNACCENT', False): where = "to_tsvector(unaccent(name)) @@ to_tsquery(unaccent(%s))" # noqa results = Map.objects.filter(share_status=Map.PUBLIC)