You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pgml-docs/docs/blog/postgres-full-text-search-is-awesome.md
+6-3Lines changed: 6 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ This is good enough for most of the use cases out there, without introducing any
26
26
<figcaption>What we were promised</figcaption>
27
27
</figure>
28
28
29
-
Academics have spent decades inventing many algorithms that use orders of magnitude more compute eking out marginally better results that often aren't worth it in practice. Not to generally disparage academia, their work has consistently improved our world, but we need to pay attention to tradeoffs.
29
+
Academics have spent decades inventing many algorithms that use orders of magnitude more compute eking out marginally better results that often aren't worth it in practice. Not to generally disparage academia, their work has consistently improved our world, but we need to pay attention to tradeoffs. SQL is another acronym similiarly pioneered in the 1970's. One difference between SQL and BM25 is that everyone has heard of the former before reading this blog post, for good reason.
30
30
31
31
If you actually want to meaningfully improve search results, you generally need to add new data sources. Relevance is much more often revealed by the way other things **_relate_** to the document, rather than the content of the document itself. Google proved the point 23 years ago. Pagerank doesn't rely on the page content itself as much as it uses metadata from _links to the pages_. We live in a connected world and it's the interplay among things that reveal their relevance, whether that is links for websites, sales for products, shares for social posts... It's the greater context around the document that matters.
32
32
@@ -46,18 +46,20 @@ With a single SQL query, you can do multiple passes of re-ranking, pruning and p
46
46
47
47
These queries can execute in milliseconds on large production-sized corpora with Postgres's multiple indexing strategies. You can do all of this without adding any new infrastructure to your stack.
48
48
49
-
The following full blown example is for demonstration purposes only. You may want to try the PostgresML Gym to work up to the full understanding.
49
+
The following full blown example is for demonstration purposes only of a 3rd generation search engine. You can test it for real in the PostgresML Gym to build up a complete understanding.
50
50
51
51
<centermarkdown>
52
52
[Try the PostgresML Gym](https://gym.postgresml.org/){ .md-button .md-button--primary }
53
53
</center>
54
54
55
55
```sql title="search.sql" linenums="1"
56
56
WITH query AS (
57
-
-- construct a query context with data that would typically be
57
+
-- construct a query context with arguments that would typically be
58
58
-- passed in from the application layer
59
59
SELECT
60
+
-- a keyword query for "my" OR "search" OR "terms"
0 commit comments