#27899: Phrase search query for Postgres full text search
-----------------------------------------+------------------------
               Reporter:  Ilya Semenov   |          Owner:  nobody
                   Type:  New feature    |         Status:  new
              Component:  Uncategorized  |        Version:  1.10
               Severity:  Normal         |       Keywords:
           Triage Stage:  Unreviewed     |      Has patch:  0
    Needs documentation:  0              |    Needs tests:  0
Patch needs improvement:  0              |  Easy pickings:  0
                  UI/UX:  0              |
-----------------------------------------+------------------------
 Postgres 9.6 now supports phrase search with `... @@
 phraseto_tsquery('hello world')`. It would be great if Django supported it
 natively.

 Currently, `django.contrib.postgres.search.SearchQuery` hard-codes SQL
 lookup formatting:

 {{{#!python
 class SearchQuery(SearchQueryCombinable, Value):
     def as_sql(self, compiler, connection):
         ...
             template = 'plainto_tsquery({}::regconfig,
 %s)'.format(config_sql)
 }}}

 I believe the lookup function should be taken from a class level variable
 instead, and two more classes should be introduced: `PhraseSearchQuery`
 using `phraseto_tsquery`, and `RawSearchQuery` using `to_tsquery`.

--
Ticket URL: <https://code.djangoproject.com/ticket/27899>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.82e6fe591654790d47a87bb44c04e078%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to