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: CHANGELOG.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,32 @@
1
+
# v0.6.0
2
+
3
+
## New 🔥
4
+
5
+
**BM25 Full-Text Search** is now available via the new `Torus.bm25/5` macro!
6
+
7
+
[BM25](https://en.wikipedia.org/wiki/Okapi_BM25) is a modern ranking algorithm that generally provides superior relevance scoring compared to traditional TF-IDF (used by `full_text/5`). This integration uses the [pg_textsearch](https://github.com/timescale/pg_textsearch) extension by Timescale.
8
+
9
+
Key features:
10
+
11
+
- State-of-the-art BM25 ranking with configurable index parameters (k1, b)
12
+
- Blazingly fast top-k queries via Block-Max WAND optimization (`Torus.bm25/5` + `limit`)
@@ -74,20 +75,39 @@ See [`full_text/5`](https://hexdocs.pm/torus/Torus.html#full_text/5) for more de
74
75
1.**Full text**: Uses term-document matrix vectors for, enabling efficient querying and ranking based on term frequency. Supports prefix search and is great for large datasets to quickly return relevant results. See [PostgreSQL Full Text Search](https://www.postgresql.org/docs/current/textsearch.html) for internal implementation details.
75
76
76
77
```elixir
77
-
iex>insert_post!(title:"Hogwarts Shocker", body:"A spell disrupts the Quidditch Cup.")
78
-
...>insert_post!(title:"Diagon Bombshell", body:"Secrets uncovered in the heart of Hogwarts.")
Use it when you don’t care about spelling, the documents are long, or if you need to order the results by rank.
89
+
Use it when you don't care about spelling, the documents are long, you need multi-column search with weights, or if you need to order the results by rank.
88
90
89
91
See [`full_text/5`](https://hexdocs.pm/torus/Torus.html#full_text/5) for more details.
90
92
93
+
1.**BM25 full text**: Modern BM25 ranking algorithm for superior relevance scoring using the [pg_textsearch](https://github.com/timescale/pg_textsearch) extension. BM25 generally provides better ranking than traditional built-in TF-IDF full text search and is optimized for top-k queries.
94
+
95
+
```elixir
96
+
insert_post!(title:"Hogwarts Shocker", body:"A spell disrupts the Quidditch Cup.")
97
+
insert_post!(title:"Diagon Bombshell", body:"Secrets uncovered in the heart of Hogwarts.")
Use it when you need state-of-the-art relevance ranking for single-column search, especially with LIMIT clauses. Requires PostgreSQL 17+.
108
+
109
+
See [`bm25/5`](https://hexdocs.pm/torus/Torus.html#bm25/5) and the [BM25 Search Guide](https://dimamik.com/posts/bm25_search) for detailed setup instructions and examples.
110
+
91
111
1.**Semantic Search**: Understands the contextual meaning of queries to match and retrieve related content utilizing natural language processing. Read more about semantic search in [Semantic search with Torus guide](/guides/semantic_search.md).
92
112
93
113
```elixir
@@ -131,7 +151,7 @@ Torus offers a few helpers to debug, explain, and analyze your queries before us
131
151
132
152
## Torus support
133
153
134
-
For now, Torus supports pattern match, similarity, full-text, and semantic search, with plans to expand support further. These docs will be updated with more examples on which search type to choose and how to make them more performant (by adding indexes or using specific functions).
154
+
For now, Torus supports pattern match, similarity, full-text (TF-IDF and BM25), and semantic search, with plans to expand support further. These docs will be updated with more examples on which search type to choose and how to make them more performant (by adding indexes or using specific functions).
0 commit comments