In Django, since version 1.11 we have a class for PostgreSQL GinIndex
(https://docs.djangoproject.com/en/1.11/ref/contrib/postgres/indexes/). I\'d like to creat
Haven't yet had a chance to migrate my old manual CREATE INDEX codes to the new system introduced in 1.11 but my understanding is
from django.contrib.postgres.indexes import GinIndex
import django.contrib.postgres.search as pg_search
class EntryLine(models.Model):
speaker = models.CharField(max_length=512, db_index=True)
text = models.TextField()
sv = pg_search.SearchVectorField(null=True)
class Meta:
indexes = [GinIndex(fields=['sv'])]
Is what's required. Raw SQL CREATE INDEX statements need not be used any more