Trying to use Postgres search in Django using SearchVector and I want to exclude results if contain a given string. Is it possible?
Example from docs:
Entry.objects.annotate(search=SearchVector('body_text', 'blog__tagline')).filter(search='Cheese')
What if I want to exclude objects whose blog__tagline contains "queso"?
I can't exclude objects with "queso" before annotation because I want to include them when a search is not performed.
if you need a quick fix, i'd recommend
exclude.