As documentation and to explain for myself how I’ve improved the search across the main table (sites) for thesis.
-
ILIKEoperators + indexes on the searched columns -
Weighted calculations - attributing a multiplier to the matches based on the most significant columns first. Matching the name is more important than the author, for example.
-
Using the
unaccentfunction such that diacritics are stripped -
Using
pg_trgmforword_similarity
Before implementing any of this, in my requirements I’ve laid out that I’ll be using Elasticsearch. However, at this stage, spawning a new service for something that pg_trgm does pretty well is redundant.