search: pass dictionary configuration to search query (#40088)
This commit is contained in:
parent
34bc84a5cf
commit
aa547dbfca
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue