[Django] #31296: Clarify what happens

15 views
Skip to first unread message

Django

unread,
Feb 21, 2020, 5:34:07 AM2/21/20
to django-...@googlegroups.com
#31296: Clarify what happens
------------------------------------------------+------------------------
Reporter: Baptiste Mispelon | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 3.0
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 |
------------------------------------------------+------------------------
The documentation for full text search [1] explains that you can pass a
`config` parameter to both `SearchVector` and `SearchQuery` but it's not
clear to me if you need to pass the same configuration to both or what
happens if you pass two different configurations to each object.

In other words, is there a difference between the following 3 scenarios:

{{{#!python
# from the documentation
Entry.objects.annotate(
... search=SearchVector('body_text', config='french'),
... ).filter(search=SearchQuery('œuf', config='french'))

Entry.objects.annotate(
... search=SearchVector('body_text', config='french'),
... ).filter(search=SearchQuery('œuf'))

Entry.objects.annotate(
... search=SearchVector('body_text'),
... ).filter(search=SearchQuery('œuf', config='french'))
}}}


And also, what happens when you try different configurations in the same
query:
{{{#!python

Entry.objects.annotate(
... search=SearchVector('body_text', config='english'),
... ).filter(search=SearchQuery('œuf', config='french'))

}}}

[1] https://docs.djangoproject.com/en/3.0/ref/contrib/postgres/search
/#changing-the-search-configuration

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

Django

unread,
Feb 22, 2020, 9:35:20 AM2/22/20
to django-...@googlegroups.com
#31296: Document different config scenarios of full text search configuration
-------------------------------------+-------------------------------------

Reporter: Baptiste Mispelon | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: 3.0
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 1

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by ChillarAnand):

* cc: ChillarAnand (added)
* needs_docs: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/31296#comment:1>

Django

unread,
Feb 24, 2020, 2:15:27 AM2/24/20
to django-...@googlegroups.com
#31296: Document different config scenarios of full text search configuration.
-------------------------------------+-------------------------------------

Reporter: Baptiste Mispelon | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: 3.0
Severity: Normal | Resolution: wontfix

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* status: new => closed
* needs_docs: 1 => 0
* resolution: => wontfix


Comment:

Baptiste, thanks for this ticket, however it's an extensive topic and IMO
[https://docs.djangoproject.com/en/3.0/ref/contrib/postgres/search
/#changing-the-search-configuration the current explanation] is sufficient
for Django documentation. You should use PostgreSQL's docs for more
complicated scenarios e.g. using different configs.

--
Ticket URL: <https://code.djangoproject.com/ticket/31296#comment:2>

Reply all
Reply to author
Forward
0 new messages