Opened 2 years ago

Closed 2 years ago

#31296 closed Cleanup/optimization (wontfix)

Document different config scenarios of full text search configuration.

Reported by: Baptiste Mispelon Owned by: nobody
Component: Documentation Version: 3.0
Severity: Normal Keywords:
Cc: ChillarAnand Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


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:

# from the documentation
...     search=SearchVector('body_text', config='french'),
... ).filter(search=SearchQuery('œuf', config='french'))

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

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

And also, what happens when you try different configurations in the same query:

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


Change History (2)

comment:1 Changed 2 years ago by ChillarAnand

Cc: ChillarAnand added
Needs documentation: set
Summary: Clarify what happensDocument different config scenarios of full text search configuration

comment:2 Changed 2 years ago by Mariusz Felisiak

Needs documentation: unset
Resolution: wontfix
Status: newclosed
Summary: Document different config scenarios of full text search configurationDocument different config scenarios of full text search configuration.

Baptiste, thanks for this ticket, however it's an extensive topic and IMO the current explanation is sufficient for Django documentation. You should use PostgreSQL's docs for more complicated scenarios e.g. using different configs.

Note: See TracTickets for help on using tickets.
Back to Top