Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"Another problem with full text search is that words are broken up according to the rules defined by the language of the text"

You can use to_tsvector('simple', column_name) if you don't want a language-specific parse, or you can make your own.

"This means that searching for “yorick” or “peterse” will match the data, but searching for “yor” will not"

You can use prefix searching:

  select to_tsvector('simple', 'Yorick Peterse') @@ to_tsquery('simple', 'yor:*') --true
Heck you can even do suffix searching:

  select to_tsvector('simple', reverse('Yorick Peterse')) @@ to_tsquery('simple', reverse('rick') || ':*')
The real problem with PostgreSQL's text search is that it doesn't support BM 25 or TFIDF out of the box


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: