Opened 6 years ago

Last modified 8 months ago

#28041 new New feature

Postgres prefix searching for full text search

Reported by: Joe Tsoi Owned by:
Component: contrib.postgres Version: 1.10
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

I've needed prefix matching in full text search. As in #27899, It would be nice to add a RawSearchQuery, but also to have it accept a Lexeme so your query might look something like

Dog.objects.annotate(search=SearchVector('name')).filter(search=RawSearchQuery(Lexeme('opt', prefix=True)))

and combine Lexemes together either ANDing, ORing instead of just letting the user specify the query as a postgres string (https://www.postgresql.org/docs/9.6/static/datatype-textsearch.html#DATATYPE-TSQUERY)

Dog.objects.annotate(search=SearchVector('name')).filter(search=RawSearchQuery(Lexeme('opt', prefix=True) + Lexeme('blah', invert=True))

Change History (8)

comment:1 Changed 6 years ago by Joe Tsoi

Owner: changed from nobody to Joe Tsoi
Status: newassigned

comment:2 Changed 6 years ago by Joe Tsoi

Component: Uncategorizedcontrib.postgres
Type: UncategorizedNew feature

comment:3 Changed 6 years ago by Tim Graham

Triage Stage: UnreviewedAccepted

comment:4 Changed 6 years ago by Joe Tsoi

Has patch: set

comment:5 Changed 6 years ago by Tim Graham

Needs documentation: set
Needs tests: set

comment:6 Changed 2 years ago by Jacob Walls

Needs documentation: unset
Needs tests: unset
Owner: changed from Joe Tsoi to Karl Hobley

comment:7 Changed 2 years ago by Mariusz Felisiak

Patch needs improvement: set

comment:8 Changed 8 months ago by Mariusz Felisiak

Owner: Karl Hobley deleted
Status: assignednew
Note: See TracTickets for help on using tickets.
Back to Top