Construire un système de blog avec recherche full-text PostgreSQL, analytics par fenêtre temporelle (window functions), et vues matérialisées pour le dashboard.
Durée estimée : 3–4 heures
-- Recherche full-text avec ranking et snippet
SELECT
a.title,
ts_rank(a.search_vector, query) AS rank,
ts_headline('french', a.body, query,
'MaxWords=30, MinWords=15, ShortWord=3, HighlightAll=FALSE') AS snippet,
au.name AS author
FROM articles a
JOIN authors au ON au.id = a.author_id,
to_tsquery('french', 'postgresql & performance') query
WHERE a.search_vector @@ query
ORDER BY rank DESC LIMIT 10;