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
_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://www.redhat.com/mailman/listinfo/patchew-devel