<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/from-sphinx-to-postgresql-full-text-search--vcr7zhlxw" -->

---
title: From Sphinx to PostgreSQL full text search · | daily.dev
description: placeholder
canonical: https://daily.dev/posts/from-sphinx-to-postgresql-full-text-search--vcr7zhlxw
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: From Sphinx to PostgreSQL full text search · | daily.dev
og:description: placeholder
og:url: https://daily.dev/posts/from-sphinx-to-postgresql-full-text-search--vcr7zhlxw
og:image: https://api.daily.dev/og/posts/vCR7ZHlXW.png
og:image:alt: From Sphinx to PostgreSQL full text search ·
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# From Sphinx to PostgreSQL full text search ·

**[RUBYLAND](https://daily.dev/sources/rubyla)** · 2 min read · 1 upvotes · 0 comments

## Summary

placeholder

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://thomasleecopeland.com/2026/08/17/from-sphinx-to-postgres-fts.html>

## Questions this post answers

### Should I replace Sphinx search with PostgreSQL full text search for a small Rails app database?

Yes, for a small dataset PostgreSQL full-text search can replace Sphinx and remove the need for a separate search process. On a database of about 3000 books, switching from Sphinx to PostgreSQL full-text search with the pg_search gem eliminated an extra architectural component while keeping search fast, using per-column weights and integrating with ActiveRecord scopes and will_paginate.

_Weighing search architecture trade-offs like Sphinx versus PostgreSQL comes up often on daily.dev._

### How do I make PostgreSQL full text search fast instead of calculating tsvectors on every query?

Calculating tsvectors on the fly is too slow for larger searches; precomputing them avoids the overhead. On PostgreSQL 18, a generated column can store the tsvector automatically instead of relying on a trigger, which was previously the standard approach, and this dropped search times from around two seconds to nearly instant on a database of a few thousand rows.

_Developers tuning Postgres full text search performance often compare approaches like this on daily.dev._

### Does the pg_search Ruby gem work with ActiveRecord pagination libraries like will_paginate?

Yes, the pg_search gem's pg_search_scope method returns a standard ActiveRecord scope, so it integrates directly with pagination libraries such as will_paginate without extra glue code. This makes it straightforward to wire PostgreSQL full-text search results into existing Rails query chains.

_Rails developers picking search gems can track integration details like this on daily.dev._

## Similar posts on daily.dev

- [Assess and migrate SQL Server Full-Text Search to Babelfish for Aurora PostgreSQL](https://daily.dev/posts/assess-and-migrate-sql-server-full-text-search-to-babelfish-for-aurora-postgresql-dgdtmwtsf) · AWS Database Blog · 0 upvotes · 0 comments
- [Full text search and PostgreSQL](https://daily.dev/posts/full-text-search-and-postgresql-yycwvcsig) · Phil Eaton · 0 upvotes · 0 comments
- [Postgres Full-Text Search Instead of Elasticsearch](https://daily.dev/posts/postgres-full-text-search-instead-of-elasticsearch-85slaibvz) · Prisma Blog · 0 upvotes · 0 comments
- [textsearch v1.0](https://daily.dev/posts/textsearch-v1-0-horrlwped) · PostgreSQL · 0 upvotes · 0 comments
- [Migrate multilingual full-text search from SQL Server to PostgreSQL](https://daily.dev/posts/migrate-multilingual-full-text-search-from-sql-server-to-postgresql-ugg1dxlwv) · AWS Database Blog · 0 upvotes · 0 comments

---

Tags: [#postgresql](https://daily.dev/tags/postgresql), [#rails](https://daily.dev/tags/rails), [#full-text-search](https://daily.dev/tags/full-text-search)

[View this post on daily.dev](https://daily.dev/posts/from-sphinx-to-postgresql-full-text-search--vcr7zhlxw)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"From Sphinx to PostgreSQL full text search ·","url":"https://daily.dev/posts/from-sphinx-to-postgresql-full-text-search--vcr7zhlxw","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/from-sphinx-to-postgresql-full-text-search--vcr7zhlxw"},"datePublished":"2026-08-18T00:48:13.212Z","dateModified":"2026-09-14T07:42:36.251Z","description":"placeholder","image":"https://media.daily.dev/image/upload/s--VDukGCjf--/f_auto/v1722860399/public/Placeholder%2002","thumbnailUrl":"https://media.daily.dev/image/upload/s--VDukGCjf--/f_auto/v1722860399/public/Placeholder%2002","isAccessibleForFree":true,"articleSection":"RUBYLAND","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"RUBYLAND","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/rubyla","url":"https://daily.dev/sources/rubyla"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/from-sphinx-to-postgresql-full-text-search--vcr7zhlxw","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"postgresql,rails,full-text-search","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"RUBYLAND","item":"https://daily.dev/sources/rubyla"},{"@type":"ListItem","position":3,"name":"From Sphinx to PostgreSQL full text search ·"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/from-sphinx-to-postgresql-full-text-search--vcr7zhlxw#faq","mainEntity":[{"@type":"Question","name":"Should I replace Sphinx search with PostgreSQL full text search for a small Rails app database?","acceptedAnswer":{"@type":"Answer","text":"Yes, for a small dataset PostgreSQL full-text search can replace Sphinx and remove the need for a separate search process. On a database of about 3000 books, switching from Sphinx to PostgreSQL full-text search with the pg_search gem eliminated an extra architectural component while keeping search fast, using per-column weights and integrating with ActiveRecord scopes and will_paginate. Weighing search architecture trade-offs like Sphinx versus PostgreSQL comes up often on daily.dev."}},{"@type":"Question","name":"How do I make PostgreSQL full text search fast instead of calculating tsvectors on every query?","acceptedAnswer":{"@type":"Answer","text":"Calculating tsvectors on the fly is too slow for larger searches; precomputing them avoids the overhead. On PostgreSQL 18, a generated column can store the tsvector automatically instead of relying on a trigger, which was previously the standard approach, and this dropped search times from around two seconds to nearly instant on a database of a few thousand rows. Developers tuning Postgres full text search performance often compare approaches like this on daily.dev."}},{"@type":"Question","name":"Does the pg_search Ruby gem work with ActiveRecord pagination libraries like will_paginate?","acceptedAnswer":{"@type":"Answer","text":"Yes, the pg_search gem's pg_search_scope method returns a standard ActiveRecord scope, so it integrates directly with pagination libraries such as will_paginate without extra glue code. This makes it straightforward to wire PostgreSQL full-text search results into existing Rails query chains. Rails developers picking search gems can track integration details like this on daily.dev."}}]}
```

