Reputation: 309
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
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
Reputation: 105
You may try Haystack or user-created library djorm-ext-pgfulltext. Also it is useful to read https://code.djangoproject.com/ticket/4676 and http://bogdan-ivanov.com/entry/full-text-search-postgresql-and-django/
Upvotes: 2
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