Skip to content

feat(blog): add Postgres full-text search post - #8093

Merged
nurul3101 merged 1 commit into
mainfrom
feat/blog-postgres-full-text-search
Jul 22, 2026
Merged

feat(blog): add Postgres full-text search post#8093
nurul3101 merged 1 commit into
mainfrom
feat/blog-postgres-full-text-search

Conversation

@nurul3101

@nurul3101 nurul3101 commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

Part 5 of the Postgres features series: You Don't Need Elasticsearch, Postgres Already Has Full-Text Search.

  • Ranked search built from one generated tsvector column, a GIN index, websearch_to_tsquery, and ts_rank, with setweight title/body weighting
  • Typo tolerance via pg_trgm with a trigram "did you mean" fallback
  • Runnable Bun + pg demo against a temporary Prisma Postgres database (npx create-db)
  • Honest "when you actually need Elasticsearch" section with a comparison table (BM25, faceted aggregations, log search, multi-language)
  • Hero + meta images in the Eclipse house style; part 4 gains its next: series pointer

Verification

  • Every SQL statement and the full demo script executed against PostgreSQL 17.2; all shown outputs are real captures
  • All 16 outbound links return 200; blog link linter passes for the new post
  • Three adversarial review rounds (technical accuracy vs. PostgreSQL/Prisma docs, prose and series consistency vs. part 4); 15 findings fixed, final round clean
  • FAQ accordion bodies confirmed server-rendered; metaTitle/metaDescription/OG image verified on the served page

Summary by CodeRabbit

  • Documentation
    • Added a new blog post explaining how to use PostgreSQL for full-text search, ranking, phrase matching, typo tolerance, and search suggestions.
    • Included practical SQL and TypeScript examples, comparisons with Elasticsearch, FAQs, and implementation guidance.
    • Updated blog navigation to link the new article in sequence.

Part 5 of the Postgres features series: ranked search with a generated
tsvector column, GIN index, websearch_to_tsquery, and ts_rank, plus
pg_trgm typo tolerance, demoed on a temporary Prisma Postgres database.
All SQL outputs are real captures from PostgreSQL 17.2.

Also links part 4 forward via its next: frontmatter pointer.
@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blog Ready Ready Preview, Comment Jul 22, 2026 8:00am
docs Ready Ready Preview, Comment Jul 22, 2026 8:00am
eclipse Ready Ready Preview, Comment Jul 22, 2026 8:00am
site Ready Ready Preview, Comment Jul 22, 2026 8:00am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Adds a blog article explaining Postgres full-text search, a runnable Bun and TypeScript demonstration with trigram typo recovery, guidance on Elasticsearch tradeoffs, and series navigation updates.

Changes

Postgres Search Article

Layer / File(s) Summary
Article metadata and series navigation
apps/blog/content/blog/you-dont-need-elasticsearch-postgres-already-has-full-text-search/index.mdx, apps/blog/content/blog/you-dont-need-a-job-queue-postgres-already-has-skip-locked/index.mdx
Adds article metadata and connects the existing series post to the new article.
Full-text search concepts and SQL
apps/blog/content/blog/you-dont-need-elasticsearch-postgres-already-has-full-text-search/index.mdx
Explains tsvector, query parsing, ranking, highlighting, generated columns, and GIN indexes.
Runnable search demonstration
apps/blog/content/blog/you-dont-need-elasticsearch-postgres-already-has-full-text-search/index.mdx
Adds Bun and TypeScript setup, temporary database provisioning, search queries, ranked output, and trigram fallback behavior.
Search scope and reference guidance
apps/blog/content/blog/you-dont-need-elasticsearch-postgres-already-has-full-text-search/index.mdx
Covers typo tolerance, Elasticsearch use cases, alternatives, FAQs, and the article recap.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • prisma/web#8079: Updates related blog-series frontmatter and navigation links.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding a blog post about PostgreSQL full-text search.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/blog-postgres-full-text-search

Comment @coderabbitai help to get the list of available commands.

@argos-ci

argos-ci Bot commented Jul 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected 1 ignored Jul 22, 2026, 8:07 AM

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
apps/blog/content/blog/you-dont-need-elasticsearch-postgres-already-has-full-text-search/index.mdx (1)

186-207: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Surface the actual create-db failure reason instead of a generic error.

When create() fails, the CLI's --json output returns { success: false, error, message, ... } with no connectionString. The current check only tests !connectionString and throws a generic message, discarding the real cause (auth failure, quota, region unavailable, etc.), which makes the demo harder to debug for readers who hit a failure.

♻️ Proposed fix to surface the real error
   const output = await $`bunx create-db@latest --region eu-central-1 --json`
     .quiet()
     .json();

-  const connectionString = output.connectionString;
-
-  if (!connectionString) {
-    throw new Error("Could not find a connection string.");
-  }
+  if (!output.success || !output.connectionString) {
+    throw new Error(
+      `Failed to create database: ${output.message ?? "unknown error"}`,
+    );
+  }
+
+  const connectionString = output.connectionString;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@apps/blog/content/blog/you-dont-need-elasticsearch-postgres-already-has-full-text-search/index.mdx`
around lines 186 - 207, Update createDatabase to inspect the create-db JSON
result’s success/error/message fields before the connectionString check. When
creation fails or no connection string is returned, throw an error that includes
the CLI-provided failure details, while preserving the existing URL setup and
readiness flow for successful results.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@apps/blog/content/blog/you-dont-need-elasticsearch-postgres-already-has-full-text-search/index.mdx`:
- Around line 186-207: Update createDatabase to inspect the create-db JSON
result’s success/error/message fields before the connectionString check. When
creation fails or no connection string is returned, throw an error that includes
the CLI-provided failure details, while preserving the existing URL setup and
readiness flow for successful results.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 67a372d5-ce89-46fa-9b53-f75ffb2c4c23

📥 Commits

Reviewing files that changed from the base of the PR and between b6806c8 and 2ae76da.

⛔ Files ignored due to path filters (2)
  • apps/blog/public/you-dont-need-elasticsearch-postgres-already-has-full-text-search/imgs/hero.svg is excluded by !**/*.svg
  • apps/blog/public/you-dont-need-elasticsearch-postgres-already-has-full-text-search/imgs/meta.png is excluded by !**/*.png
📒 Files selected for processing (2)
  • apps/blog/content/blog/you-dont-need-a-job-queue-postgres-already-has-skip-locked/index.mdx
  • apps/blog/content/blog/you-dont-need-elasticsearch-postgres-already-has-full-text-search/index.mdx

@nurul3101
nurul3101 merged commit c8088f5 into main Jul 22, 2026
17 checks passed
@nurul3101
nurul3101 deleted the feat/blog-postgres-full-text-search branch July 22, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant