Full-text search có sẵn của PostgreSQL đủ tốt cho tìm kiếm cơ bản/nội bộ: tách từ (tokenization), xếp hạng độ liên quan, cấu hình theo ngôn ngữ, và đánh GIN index trên kiểu tsvector.
Nó không thay thế Elasticsearch/OpenSearch khi cần relevance phức tạp, chịu lỗi gõ sai mạnh (typo tolerance), search phân tích, hay quy mô phân tán.
CREATE INDEX idx_articles_search ON articles USING gin (to_tsvector('english', title || ' ' || body));Mẹo trả lời: nếu search chỉ là tính năng phụ → dùng PostgreSQL cho gọn; nếu search là trải nghiệm cốt lõi của sản phẩm → cân nhắc search engine chuyên dụng.
PostgreSQL's built-in full-text search is good enough for basic/internal search: tokenization, relevance ranking, per-language configuration, and a GIN index on the tsvector type.
It does not replace Elasticsearch/OpenSearch when you need complex relevance, strong typo tolerance, search analytics, or distributed scale.
CREATE INDEX idx_articles_search ON articles USING gin (to_tsvector('english', title || ' ' || body));Answer tip: if search is a minor feature → keep it in PostgreSQL; if search is a core product experience → consider a dedicated search engine.