As documentation and to explain for myself how I’ve improved the search across the main table (sites) for thesis.

  1. ILIKE operators + indexes on the searched columns

  2. 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.

  3. Using the unaccent function such that diacritics are stripped

  4. Using pg_trgm for word_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.