[Patchew-devel] [PATCH 0/2] postgresql: use full text search

Paolo Bonzini pbonzini at redhat.com
Mon Nov 19 13:42:34 UTC 2018


We can use full text search with word stemming for subject searches,
and trigram search (which automatically optimizes LIKE '%foo%') for
sender and recipient search.  Both require creating an inverted
("GIN") index.  Django provides a GinIndex class, but I'm using
SQL manually to avoid breaking SQLite.

Unfortunately, there is a bug in Postgres that prevents using the
index for subject search.  Patch 2 works around it.

Paolo

Paolo Bonzini (2):
  use postgresql full text search
  work around bug in postgresql full text search

 api/migrations/0040_postgres_fts.py | 26 +++++++++++++++++
 api/migrations/__init__.py          | 15 ++++++++++
 api/search.py                       | 44 +++++++++++++++++++++++------
 patchew/settings.py                 |  3 ++
 4 files changed, 80 insertions(+), 8 deletions(-)
 create mode 100644 api/migrations/0040_postgres_fts.py

-- 
2.19.1




More information about the Patchew-devel mailing list