Use plainto_tsquery instead of to_tsquery to allow multiple words
This commit is contained in:
parent
d99a208226
commit
d7649b3a66
1 changed files with 1 additions and 1 deletions
|
@ -141,7 +141,7 @@ class Search(TemplateView, PaginatorMixin):
|
||||||
q = self.request.GET.get('q')
|
q = self.request.GET.get('q')
|
||||||
results = []
|
results = []
|
||||||
if q:
|
if q:
|
||||||
where = "to_tsvector(name) @@ to_tsquery(%s)"
|
where = "to_tsvector(name) @@ plainto_tsquery(%s)"
|
||||||
if getattr(settings, 'UMAP_USE_UNACCENT', False):
|
if getattr(settings, 'UMAP_USE_UNACCENT', False):
|
||||||
where = "to_tsvector(unaccent(name)) @@ to_tsquery(unaccent(%s))" # noqa
|
where = "to_tsvector(unaccent(name)) @@ to_tsquery(unaccent(%s))" # noqa
|
||||||
results = Map.objects.filter(share_status=Map.PUBLIC)
|
results = Map.objects.filter(share_status=Map.PUBLIC)
|
||||||
|
|
Loading…
Reference in a new issue