<story><title>Postgres full-text search: A search engine in a database (2021)</title><url>https://www.crunchydata.com/blog/postgres-full-text-search-a-search-engine-in-a-database</url></story><parent_chain></parent_chain><comment><author>simonw</author><text>The hardest part of building any search engine is keeping the index up-to-date with changes made to the underlying data store.&lt;p&gt;It&amp;#x27;s a solvable problem, but it&amp;#x27;s always a lot of work to build and to keep working as the database schema changes in the future.&lt;p&gt;This is why I really like PostgreSQL FTS: it&amp;#x27;s good enough that for many projects I don&amp;#x27;t need to use an external search engine any more - and it&amp;#x27;s way easier to keep the search index up-to-date than if the index lives in a separate system.&lt;p&gt;I wrote this tutorial on implementing faceted search with PostgreSQL and Django a while ago: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;simonwillison.net&amp;#x2F;2017&amp;#x2F;Oct&amp;#x2F;5&amp;#x2F;django-postgresql-faceted-search&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;simonwillison.net&amp;#x2F;2017&amp;#x2F;Oct&amp;#x2F;5&amp;#x2F;django-postgresql-facet...&lt;/a&gt;</text></comment>
<story><title>Postgres full-text search: A search engine in a database (2021)</title><url>https://www.crunchydata.com/blog/postgres-full-text-search-a-search-engine-in-a-database</url></story><parent_chain></parent_chain><comment><author>crtxcr</author><text>I was a bit disappointed by some limitations back then when I tried it for a project of mine. When searching phrases where ordering matters, phraseto_tsquery() does not quite work for larger documents, as the tsvector position values are quite limited: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;www.postgresql.org&amp;#x2F;docs&amp;#x2F;14&amp;#x2F;textsearch-limitations.html&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;www.postgresql.org&amp;#x2F;docs&amp;#x2F;14&amp;#x2F;textsearch-limitations.ht...&lt;/a&gt; Here I had much better success with sqlite&amp;#x27;s FTS implemention.</text></comment>