Understand full-text search with Postgres
Table of content
- Create demo DB tables
- Stemmer — Building documents
- Search — Building queries
- Performance practises
- Setting weight and ranking
- Improve search quality
- 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.
- Pretty rich in features
- Flexible and extensible
- Maybe you already have it
- Low entry point
- If your technology stack is already over-engineered