Jaf
Jaf

Reputation: 309

Full text search using postgresql-8.4 and django

Full text search with mysql & django can be done using following django api query

Entry.objects.filter(headline__search="search text")

This returns result set properly.But this can't be used with postgresql, while using getting an exception which is shown below

Full-text search is not implemented for this database backend 

How can i imlement full text search with postgresql & django which is same as that of django-mysql full text search?

Upvotes: 3

Views: 1908

Answers (3)

Paolo Melchiorre
Paolo Melchiorre

Reputation: 6112

For user reading this question these days:

PostgreSQL Full-Text-Search support is present since Django 1.10 (2016) by the module django.contrib.postgres.search .

Upvotes: 0

Rohan
Rohan

Reputation: 53316

You can try

Entry.objects.filter(headline__contains="search text")

or __icontains for case-insensitive search.

As the django doc says __search only works with MySQL for now.

Upvotes: 4

Related Questions