I am trying to add GinIndex to my model however, I am getting an error when migrating:
django.db.utils.ProgrammingError: data type character varying has no default operator class for access method "gin"
HINT: You must specify an operator class for the index or define a default operator class for the data type.
This is my model:
class Post(models.Model):
title = models.CharField(max_length=100)
guid_url = models.CharField(max_length=255,unique=True, null=True)
content = models.TextField(validators=[MaxLengthValidator(1200)])
author = models.ForeignKey(Profile, on_delete=models.CASCADE)
date_posted = models.DateTimeField(auto_now_add=True)
last_edited= models.DateTimeField(auto_now=True)
tags = TaggableManager(help_text="Tags", blank=True)
likes= models.ManyToManyField(Profile, blank=True, related_name='post_likes')
class Meta:
indexes = [
GinIndex(fields=['title','content'],name='search_idx_post')
]
I was wondering what is causing this issue I cannot find how to resolve this issue.
Thanks in advance!