search: pass dictionary configuration to search query (#40088)

This commit is contained in:
Frédéric Péters 2020-02-21 16:16:19 +01:00
parent 34bc84a5cf
commit aa547dbfca
1 changed files with 1 additions and 1 deletions

View File

@ -81,7 +81,7 @@ def search_site(request, query):
if connection.vendor == 'postgresql':
config = settings.POSTGRESQL_FTS_SEARCH_CONFIG
vector = SearchVector('title', config=config, weight='A') + SearchVector('indexed_text', config=config, weight='A')
query = SearchQuery(query)
query = SearchQuery(query, config=config)
qs = IndexedCell.objects.annotate(rank=SearchRank(vector, query)).filter(rank__gte=0.3).order_by('-rank')
else:
qs = IndexedCell.objects.filter(