add unaccent to full text search vectors

This commit is contained in:
smilerz
2021-04-25 19:35:17 -05:00
parent 447324e673
commit 6eaf519fd6
5 changed files with 10 additions and 10 deletions

View File

@ -18,8 +18,8 @@ class Command(BaseCommand):
try:
with scopes_disabled():
search_vector = (
SearchVector('name', weight='A')
+ SearchVector('description', weight='B'))
SearchVector('name__unaccent', weight='A')
+ SearchVector('description__unaccent', weight='B'))
Recipe.objects.all().update(search_vector=search_vector)
self.stdout.write(self.style.SUCCESS(_('Recipe index rebuild complete.')))