Closed Semprini closed 4 months ago
` from django.db import models from django.db.models import F from django.contrib.postgres.search import SearchVector, SearchVectorField
class Blog(models.Model): body = models.TextField() title = models.TextField() search_vector = models.GeneratedField( expression=SearchVector("title", config="english") + SearchVector("body", config="english"), output_field=SearchVectorField(), db_persist=True, ) `
` from django.db import models from django.db.models import F from django.contrib.postgres.search import SearchVector, SearchVectorField
class Blog(models.Model): body = models.TextField() title = models.TextField() search_vector = models.GeneratedField( expression=SearchVector("title", config="english") + SearchVector("body", config="english"), output_field=SearchVectorField(), db_persist=True, ) `