[Django] #31386: Add support for the PostgresSQL ts_rank_cd function

29 views
Skip to first unread message

Django

unread,
Mar 20, 2020, 4:58:07 PM3/20/20
to django-...@googlegroups.com
#31386: Add support for the PostgresSQL ts_rank_cd function
-------------------------------------+-------------------------------------
Reporter: Hannes | Owner: Hannes Ljungberg
Ljungberg |
Type: New | Status: assigned
feature |
Component: | Version: master
contrib.postgres | Keywords: postgres search
Severity: Normal | ts_rank_cd
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
The `ts_rank_cd` function is used as an alternative to `ts_rank` for
penalizing query words that are further apart from each other.

I'm thinking that adding a `cover_density` parameter to `SearchRank`
should be enough. If this parameter is set to `True` the function will be
switched to `ts_rank_cd`.

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

Django

unread,
Mar 20, 2020, 5:02:51 PM3/20/20
to django-...@googlegroups.com
#31386: Add support for the PostgresSQL ts_rank_cd function
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: assigned
Component: contrib.postgres | Version: master
Severity: Normal | Resolution:
Keywords: postgres search | Triage Stage:
ts_rank_cd | Unreviewed
Has patch: 1 | Needs documentation: 0

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

* has_patch: 0 => 1


Comment:

PR: https://github.com/django/django/pull/12597

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

Django

unread,
Mar 20, 2020, 5:10:43 PM3/20/20
to django-...@googlegroups.com
#31386: Add support for the PostgresSQL ts_rank_cd function
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: assigned
Component: contrib.postgres | Version: master
Severity: Normal | Resolution:
Keywords: postgres search | Triage Stage: Ready for
ts_rank_cd | checkin
Has patch: 1 | Needs documentation: 0

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

* stage: Unreviewed => Ready for checkin


Comment:

Patch LGTM pending two minor adjustments.

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

Django

unread,
Mar 22, 2020, 7:10:57 AM3/22/20
to django-...@googlegroups.com
#31386: Add support for the PostgresSQL ts_rank_cd function
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: assigned
Component: contrib.postgres | Version: master
Severity: Normal | Resolution:
Keywords: postgres search | Triage Stage: Ready for
ts_rank_cd | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Claude Paroz):

Almost a duplicate of #28194. However, #28194 also suggests adding the
`normalization` keyword parameter. Should we keep both tickets and address
both issues separately?

--
Ticket URL: <https://code.djangoproject.com/ticket/31386#comment:3>

Django

unread,
Mar 22, 2020, 9:22:25 AM3/22/20
to django-...@googlegroups.com
#31386: Add support for the PostgresSQL ts_rank_cd function
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: assigned
Component: contrib.postgres | Version: master
Severity: Normal | Resolution:
Keywords: postgres search | Triage Stage: Ready for
ts_rank_cd | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Simon Charette):

I guess we could close this one as duplicate of #28194 and have
https://github.com/django/django/pull/12597 address both.

Is it something you're interested in doing Hannes?

--
Ticket URL: <https://code.djangoproject.com/ticket/31386#comment:4>

Django

unread,
Mar 22, 2020, 11:36:59 AM3/22/20
to django-...@googlegroups.com
#31386: Add support for the PostgresSQL ts_rank_cd function
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: assigned
Component: contrib.postgres | Version: master
Severity: Normal | Resolution:
Keywords: postgres search | Triage Stage: Ready for
ts_rank_cd | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Hannes Ljungberg):

I don’t know how I missed that ticket. Sorry about that!

Sure, let’s close this ticket in favor of #28194. I’ll update my PR to add
support for the ` normalization` parameter.

--
Ticket URL: <https://code.djangoproject.com/ticket/31386#comment:5>

Django

unread,
Mar 22, 2020, 2:06:13 PM3/22/20
to django-...@googlegroups.com
#31386: Add support for the PostgresSQL ts_rank_cd function
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: closed
Component: contrib.postgres | Version: master
Severity: Normal | Resolution: duplicate

Keywords: postgres search | Triage Stage: Ready for
ts_rank_cd | checkin
Has patch: 1 | Needs documentation: 0

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

* status: assigned => closed
* resolution: => duplicate


--
Ticket URL: <https://code.djangoproject.com/ticket/31386#comment:6>

Reply all
Reply to author
Forward
0 new messages