This is implemented using PostgreSQL's support for full-text search by creating a tsvector of several fields of each post and thread in a materialized view and indexing it.
Postgres' plainto_tsquery function is used to convert user input to search queries to be executed against the database.
ts_headline is used to display relevant snippets from search results on the output page.
Known caveats:
English is hardcoded as the query language for now
The materialised view needs to be updated after every change of posts, which currently happens at regular intervals - meaning that it is not always guaranteed to be in sync with the posts & threads on a forum
What the title says.
This is implemented using PostgreSQL's support for full-text search by creating a
tsvector
of several fields of each post and thread in a materialized view and indexing it.Postgres'
plainto_tsquery
function is used to convert user input to search queries to be executed against the database.ts_headline
is used to display relevant snippets from search results on the output page.Known caveats: