Code

Opened 8 years ago

Last modified 5 months ago

#3254 assigned New feature

[patch] experimental fulltext search support for postgres, oracle and mssql

Reported by: Ronny Pfannschmidt Owned by: mjtamlyn
Component: Database layer (models, ORM) Version:
Severity: Normal Keywords: oracle fulltext search
Cc: sam@…, johann.queuniet@…, hv@…, rboumart@…, dan.fairs@…, twidi@…, mboersma, justinlilly@…, jpic, robinchew@…, niwi@…, slav0nic@…, mpessas@… Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: yes Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description (last modified by ramiro)

I didn't like it was missing.

oracle, mssql : add a FulltextIndex for the Fields

postgresql: for each FulltextField add a extra tsvector Field named like "%(fieldname)_tsv"

Problems with sqlite fts:

  • they stated a match statement may only be used once in a query
  • it needs a very specific syntax to search multiple fields
  • i have no idea how to get that into the ORM

Attachments (3)

fts-pstgres-oracle-mssql.patch (1.8 KB) - added by Ronny Pfannschmidt <ronny.pfannschmidt@…> 8 years ago.
fts-pstgres-oracle-mssql-corrected.patch (1.8 KB) - added by djangoproject.com@… 7 years ago.
Corrected patch
fts-pstgres.patch (711 bytes) - added by rachid 6 years ago.
corrected Patch (only for postgres)

Download all attachments as: .zip

Change History (34)

Changed 8 years ago by Ronny Pfannschmidt <ronny.pfannschmidt@…>

comment:1 Changed 7 years ago by Simon G. <dev@…>

  • Summary changed from [patch] experimental fts support for postgres, oracle and mssql to [patch] experimental fulltext search support for postgres, oracle and mssql
  • Triage Stage changed from Unreviewed to Design decision needed

This is a very simple little patch - if accepted it'll need some docs. Shouldn't be too hard to implement MySQL fulltext searching too, but this will require a special index to be created.

comment:2 Changed 7 years ago by anonymous

  • Cc sam@… added

comment:3 Changed 7 years ago by djangoproject.com@…

Typo in patch: plainto_tsquery in psycoph2/base.py should be to_tsquery
Corrected patch attached.

Changed 7 years ago by djangoproject.com@…

Corrected patch

comment:4 Changed 7 years ago by ubernostrum

#4676 was a duplicate, and has an alternate implementation for PostgreSQL.

comment:5 Changed 7 years ago by djangoproject.com@…

Patches attached to this ticket do not work correctly with PostgreSQL, please use patch http://code.djangoproject.com/attachment/ticket/4676/sql.diff in ticket #4676 (which also describes the correct database set-up by the way).

comment:6 Changed 7 years ago by jacob

  • Component changed from Metasystem to Database wrapper
  • Needs documentation set
  • Needs tests set
  • Patch needs improvement set
  • Triage Stage changed from Design decision needed to Accepted

comment:7 Changed 7 years ago by anonymous

  • Cc johann.queuniet@… added

comment:8 Changed 7 years ago by jacob

  • Reporter changed from Ronny Pfannschmidt <ronny.pfannschmidt@…> to Ronny Pfannschmidt

comment:9 follow-up: Changed 6 years ago by anonymous

Postgres 8.3 now has full-text searching. Not sure if this changes anything here or not...

comment:10 in reply to: ↑ 9 Changed 6 years ago by anonymous

Replying to anonymous:

Postgres 8.3 now has full-text searching. Not sure if this changes anything here or not...

http://www.postgresql.org/docs/8.3/static/textsearch.html

comment:11 Changed 6 years ago by guettli

  • Cc hv@… added

comment:12 Changed 6 years ago by guettli

Both patches (last from june 2006) are broken since [5957]

comment:13 Changed 6 years ago by guettli

Sorry, I meant june 2007 (The date format of trac is hard to read for germans ...)

Changed 6 years ago by rachid

corrected Patch (only for postgres)

comment:14 Changed 6 years ago by rachid

  • Cc rboumart@… added

I added a Patch against 7231. It is only for postgres. But i think it would be straight forward for the other backend.

comment:15 Changed 6 years ago by danfairs

  • Cc dan.fairs@… added

comment:16 Changed 6 years ago by anonymous

  • Cc twidi@… added

comment:17 Changed 5 years ago by mboersma

  • Cc mboersma added

comment:18 Changed 5 years ago by mboersma

  • Keywords oracle fulltext search added

comment:19 Changed 5 years ago by ramiro

  • Description modified (diff)

(description)

comment:20 Changed 5 years ago by justinlilly

  • Cc justinlilly@… added

comment:21 Changed 3 years ago by lrekucki

  • Severity changed from normal to Normal
  • Type changed from enhancement to New feature

comment:22 Changed 2 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:23 Changed 2 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

comment:24 Changed 2 years ago by Stefano Crosta <stefano@…>

can this be useful? http://barryp.org/blog/entries/postgresql-full-text-search-django/

There's a special "search" method for MySQL but still nothing for PostgreSQL... any specific reason? This interesting ticket seems just abandoned!

comment:25 Changed 23 months ago by jpic

  • Cc jpic added

comment:26 Changed 19 months ago by robin

  • Cc robinchew@… added

comment:27 Changed 16 months ago by niwi

  • Cc niwi@… added

If in the future, are going to implement support for postgresql text search, you can have this as a reference implementation:
https://github.com/niwibe/djorm-ext-pgfulltext/blob/master/djorm_pgfulltext/models.py

comment:28 Changed 16 months ago by slav0nic

  • Cc slav0nic@… added

comment:29 Changed 8 months ago by mpessas

  • Cc mpessas@… added

comment:30 Changed 8 months ago by mpessas

This is definitely something I would like to see in Django and could help with (see https://github.com/mpessas/django-pg-extensions for another package that supports FTS in PostgreSQL).

Here is a suggestion as how this could be implmented for PostgreSQL:

I haven't looked into fts for some time now, so I might be forgetting something. In any case, how does this proposal sound?

comment:31 Changed 5 months ago by mjtamlyn

  • Owner changed from nobody to mjtamlyn
  • Status changed from new to assigned

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as assigned
The owner will be changed from mjtamlyn to anonymous. Next status will be 'assigned'
The ticket will be disowned. Next status will be 'new'
as The resolution will be set. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.