More efficient search index

Co-authored-by: asmr-hex <0.0@asmr.software>
This commit is contained in:
Mouse Reeve
2021-06-23 16:14:59 -07:00
parent ae1d0343ba
commit 7c15fbbb0b
4 changed files with 87 additions and 10 deletions

View File

@ -1,4 +1,5 @@
""" database schema for info about authors """
from django.contrib.postgres.indexes import GinIndex
from django.db import models
from bookwyrm import activitypub
@ -37,3 +38,8 @@ class Author(BookDataModel):
return "https://%s/author/%s" % (DOMAIN, self.id)
activity_serializer = activitypub.Author
class Meta:
"""sets up postgres GIN index field"""
indexes = (GinIndex(fields=["search_vector"]),)