Opened 8 years ago

Last modified 4 hours 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: Calvin Vu 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 (9)

comment:1 by Joe Tsoi, 8 years ago

Owner: changed from nobody to Joe Tsoi
Status: newassigned

comment:2 by Joe Tsoi, 8 years ago

Component: Uncategorizedcontrib.postgres
Type: UncategorizedNew feature

comment:3 by Tim Graham, 8 years ago

Triage Stage: UnreviewedAccepted

comment:4 by Joe Tsoi, 8 years ago

Has patch: set

comment:5 by Tim Graham, 8 years ago

Needs documentation: set
Needs tests: set

comment:6 by Jacob Walls, 4 years ago

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

comment:7 by Mariusz Felisiak, 4 years ago

Patch needs improvement: set

comment:8 by Mariusz Felisiak, 2 years ago

Owner: Karl Hobley removed
Status: assignednew

comment:9 by Calvin Vu, 4 hours ago

Cc: Calvin Vu added
Note: See TracTickets for help on using tickets.
Back to Top