<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Getting Started on Vchord</title>
    <link>https://vchord.pgsty.com/bm25/getting-started/</link>
    <description>Recent content in Getting Started on Vchord</description>
    <generator>Hugo</generator>
    <language>en-US</language>
    
    
    
      <lastBuildDate>Mon, 02 Nov 2026 19:35:19 +0800</lastBuildDate>
    
    
      <atom:link href="https://vchord.pgsty.com/bm25/getting-started/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
        <title>Overview</title>
        <link>https://vchord.pgsty.com/bm25/getting-started/overview/</link>
        <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
        
        <guid>https://vchord.pgsty.com/bm25/getting-started/overview/</guid>
        <description>&lt;p&gt;PostgreSQL includes built-in full-text search via &lt;code&gt;tsvector&lt;/code&gt;, &lt;code&gt;tsquery&lt;/code&gt;, &lt;code&gt;ts_rank&lt;/code&gt;, and &lt;code&gt;GIN&lt;/code&gt; indexes. While effective for boolean keyword matching (&lt;code&gt;@@&lt;/code&gt;), PostgreSQL&amp;rsquo;s built-in ranking has two structural limitations for modern search and Retrieval-Augmented Generation (RAG) workloads:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Suboptimal Ranking Formula (&lt;code&gt;ts_rank&lt;/code&gt;)&lt;/strong&gt;: PostgreSQL&amp;rsquo;s &lt;code&gt;ts_rank&lt;/code&gt; and &lt;code&gt;ts_rank_cd&lt;/code&gt; do not track corpus-wide &lt;strong&gt;Inverse Document Frequency (IDF)&lt;/strong&gt; or &lt;strong&gt;Average Document Length (&lt;span class=&#34;katex&#34;&gt;&lt;span class=&#34;katex-mathml&#34;&gt;&lt;math xmlns=&#34;http://www.w3.org/1998/Math/MathML&#34;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mtext&gt;avgdl&lt;/mtext&gt;&lt;/mrow&gt;&lt;annotation encoding=&#34;application/x-tex&#34;&gt;\text{avgdl}&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&#34;katex-html&#34; aria-hidden=&#34;true&#34;&gt;&lt;span class=&#34;katex-base&#34;&gt;&lt;span class=&#34;katex-strut&#34; style=&#34;height:0.8889em;vertical-align:-0.1944em;&#34;&gt;&lt;/span&gt;&lt;span class=&#34;mord text&#34;&gt;&lt;span class=&#34;mord&#34;&gt;avgdl&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;)&lt;/strong&gt; across the index. Common words are weighted the same as rare, high-signal terms, and term frequency is not properly saturated.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Exhaustive Index Scans on &lt;code&gt;ORDER BY ... LIMIT K&lt;/code&gt;&lt;/strong&gt;: A PostgreSQL &lt;code&gt;GIN&lt;/code&gt; index only accelerates boolean matching (&lt;code&gt;WHERE tsv @@ tsquery&lt;/code&gt;). To return the Top-10 highest-ranked documents, PostgreSQL must fetch &lt;strong&gt;every&lt;/strong&gt; matching row from the heap, compute &lt;code&gt;ts_rank&lt;/code&gt; for all of them, and sort the entire result set.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;how-vectorchord-bm25-solves-both-problems&#34;&gt;How VectorChord-BM25 Solves Both Problems&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;&lt;strong&gt;VectorChord-BM25 (&lt;code&gt;vchord_bm25&lt;/code&gt;)&lt;/strong&gt; introduces a dedicated PostgreSQL index access method (&lt;code&gt;USING bm25&lt;/code&gt;) and sparse BM25 scoring operator (&lt;code&gt;&amp;lt;&amp;amp;&amp;gt;&lt;/code&gt;) specifically engineered for Top-K lexical retrieval:&lt;/p&gt;</description>
      </item>
    <item>
        <title>Installation</title>
        <link>https://vchord.pgsty.com/bm25/getting-started/installation/</link>
        <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
        
        <guid>https://vchord.pgsty.com/bm25/getting-started/installation/</guid>
        <description>&lt;p&gt;&lt;code&gt;vchord_bm25&lt;/code&gt; supports &lt;strong&gt;PostgreSQL 14, 15, 16, 17, and 18&lt;/strong&gt; on Linux (&lt;code&gt;x86_64&lt;/code&gt; and &lt;code&gt;aarch64&lt;/code&gt;) and macOS.&lt;/p&gt;&#xA;&lt;h2 id=&#34;method-1-pigsty--native-os-packages-recommended&#34;&gt;Method 1: Pigsty / Native OS Packages (Recommended)&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://pgsty.com&#34;&gt;&lt;strong&gt;Pigsty&lt;/strong&gt;&lt;/a&gt; provides pre-built native RPM and DEB packages for &lt;code&gt;vchord&lt;/code&gt;, &lt;code&gt;vchord_bm25&lt;/code&gt;, and &lt;code&gt;pg_tokenizer&lt;/code&gt; across EL 8/9/10, Debian 12/13, and Ubuntu 22.04/24.04 for PostgreSQL 14–18.&lt;/p&gt;&#xA;&lt;div class=&#34;td-code td-code--untitled&#34; id=&#34;td-code-6f251e6f-fence-0&#34; data-td-code data-td-code-auto-id&#xA;     data-td-language=&#34;bash&#34; data-td-line-count=&#34;3&#34;&gt;&#xA;  &lt;div class=&#34;td-code__viewport&#34; id=&#34;td-code-6f251e6f-fence-0-viewport&#34; data-td-code-viewport&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Install via Pigsty CLI (automatically resolves PG version and OS distro)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;pig ext install vchord_bm25&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;pig ext install pg_tokenizer&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;Or install directly via &lt;code&gt;apt&lt;/code&gt; / &lt;code&gt;dnf&lt;/code&gt; once the Pigsty repository is configured:&lt;/p&gt;</description>
      </item>
    <item>
        <title>Quick Start</title>
        <link>https://vchord.pgsty.com/bm25/getting-started/quick-start/</link>
        <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
        
        <guid>https://vchord.pgsty.com/bm25/getting-started/quick-start/</guid>
        <description>&lt;p&gt;This guide walks through creating a table, tokenizing documents, building a &lt;code&gt;bm25&lt;/code&gt; index, and executing Top-K BM25 queries.&lt;/p&gt;&#xA;&lt;h2 id=&#34;workflow-a-bm25vector--pg_tokenizer-v01--v03&#34;&gt;Workflow A: &lt;code&gt;bm25vector&lt;/code&gt; + &lt;code&gt;pg_tokenizer&lt;/code&gt; (&lt;code&gt;v0.1&lt;/code&gt; – &lt;code&gt;v0.3&lt;/code&gt;)&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;In released versions &lt;code&gt;v0.1.0&lt;/code&gt; through &lt;code&gt;v0.3.0&lt;/code&gt;, &lt;code&gt;vchord_bm25&lt;/code&gt; pairs with &lt;code&gt;pg_tokenizer&lt;/code&gt; to tokenize text into a &lt;code&gt;bm25vector&lt;/code&gt; column.&lt;/p&gt;&#xA;&lt;h3 id=&#34;1-enable-extensions-and-configure-search_path&#34;&gt;1. Enable Extensions and Configure &lt;code&gt;search_path&lt;/code&gt;&#xA;&lt;/h3&gt;&#xA;&lt;div class=&#34;td-code td-code--untitled&#34; id=&#34;td-code-0e03a75f-fence-0&#34; data-td-code data-td-code-auto-id&#xA;     data-td-language=&#34;sql&#34; data-td-line-count=&#34;4&#34;&gt;&#xA;  &lt;div class=&#34;td-code__viewport&#34; id=&#34;td-code-0e03a75f-fence-0-viewport&#34; data-td-code-viewport&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;CREATE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;EXTENSION&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;IF&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;NOT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;EXISTS&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pg_tokenizer&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;CASCADE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;CREATE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;EXTENSION&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;IF&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;NOT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;EXISTS&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;vchord_bm25&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;CASCADE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;SET&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;search_path&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;TO&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;$user&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;public&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;bm25_catalog&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;tokenizer_catalog&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;h3 id=&#34;2-create-a-tokenizer&#34;&gt;2. Create a Tokenizer&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;Use &lt;code&gt;create_tokenizer&lt;/code&gt; with the built-in &lt;code&gt;llmlingua2&lt;/code&gt; (or &lt;code&gt;bert_base_uncased&lt;/code&gt;) model:&lt;/p&gt;</description>
      </item>
    
  </channel>
</rss>
