‹ BackHN Continuity

Thread

Tin: full-text search for Postgres

230 points · 98 comments · ksec

  1. groundzeros2015 · · focus · HN ↗
    Please read the Postgres manual. It has incredible built-in search capability.
    1. simonw · · focus · HN ↗
      If you mean tsvector&#x2F;tsquery - <a href="https:&#x2F;&#x2F;www.postgresql.org&#x2F;docs&#x2F;9.6&#x2F;textsearch-intro.html" rel="nofollow">https:&#x2F;&#x2F;www.postgresql.org&#x2F;docs&#x2F;9.6&#x2F;textsearch-intro.html - it&#x27;s very good, but it&#x27;s missing an important feature: ranking based on the overall document collection.

      PostgreSQL built-in FTS provides a score for each row based just on the data for that row.

      Relevance algorithms like BM25 take overall corpus statistics into account. If you search for a bunch of words and some of them are less common than others in the overall set of documents, documents that match THOSE words will score higher than matches for other words in your search.

      That&#x27;s what all of these additional extensions are providing.

      1. groundzeros2015 · · focus · HN ↗
        &gt; ranking based on the overall document collection.

        Thanks for pointing out a real difference.

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.