No full text search filter for Postgres?

177 views
Skip to first unread message

Benjamin Scherrey

unread,
Oct 7, 2014, 6:22:37 AM10/7/14
to django-res...@googlegroups.com
We have a DRF API where we want to offer search filtering on 3 of our fields. It's not really big enough to pull in solr or some dedicated option so we're trying out DRF's Search Filter capability. Was rather surprised to find this in the docs:

"""The search behavior may be restricted by prepending various characters to the search_fields.

  • '^' Starts-with search.
  • '=' Exact matches.
  • '@' Full-text search. (Currently only supported Django's MySQL backend.)"""
Full-text search is only available on MySQL?!?!? Postgres is certainly the more capable and easy to support DB in this area I would expect. Any ideas on what is the cause for this restriction? Any interest in fixing it? If interested and not hugely complicated to overcome we might be interested in creating a pull request. Would appreciate any backgrounder from someone who knows better before we dig much deeper and spend a lot of time on it, however.

thanx,

  -- Ben

Jirka Vejrazka

unread,
Oct 7, 2014, 6:44:01 AM10/7/14
to django-res...@googlegroups.com
Hi,

  I'm certainly no expert in the area, just know that Django has always supported full text search on MySQL only. Don't know the reasoning.

  Having said that, you might want to check out if you could implement your own search filter based on django-watson. I use this package extensively to provide full-text search for PostgreSQL databases. I also use DRF, but have not had the need to link those two together so far.

  HTH

    Jirka

--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-fram...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Benjamin Scherrey

unread,
Oct 7, 2014, 8:59:53 AM10/7/14
to django-res...@googlegroups.com
Ah you're right - it's a Django issue and not DRF. Question has already been asked here: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/django-users/fCcr0TaJPjw/2X3o3LuEdtEJ

Looks like it's coming but not yet arrived, alas.

thanx,

  -- Ben

Tom Christie

unread,
Oct 7, 2014, 12:10:59 PM10/7/14
to django-res...@googlegroups.com
Hi Ben - it might be worth creating a ticket for that on the REST framework GitHub site to remind us to update the documentation once Django 1.8 is released. (Assuming we get full text for postgres by then)
Reply all
Reply to author
Forward
0 new messages