Skip to content
πŸ“– Support examples for learning full-text search with use of PostgreSQL. Ready to run.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Understand full-text search with Postgres


Piotr Lewandowski, @constjs

Table of content

  1. Create demo DB tables
  2. Stemmer β€” Building documents
  3. Search β€” Building queries
  4. Performance practises
  5. Setting weight and ranking
  6. Improve search quality
  7. Further reading

When full-text search?

  • Search by content created by people (not programmers)
  • Divide more and less important fragments of document
  • Searching database dumps from WikiLeaks

Why just not RegEx?

  • RegEx is good to find only simple, finite languages

  • Helpless for grammar

  • Slow (Can be improved with Trigram Indexes)

  • Lots of pitfalls even for simple languages like HTML

  • Complicated to maintain, e.g.


Why Postgres?

  • Pretty rich in features
  • Flexible and extensible
  • Maybe you already have it
    • Low entry point
    • If your technology stack is already over-engineered
You can’t perform that action at this time.