Index: third_party/sqlite/src/ext/fts5/test/fts5aux.test |
diff --git a/third_party/sqlite/src/ext/fts5/test/fts5aux.test b/third_party/sqlite/src/ext/fts5/test/fts5aux.test |
index 995fe857845e1715f07e4fddca5222119a4d9a43..fa3167a4d118118a853a6f59b270a063d924aa0f 100644 |
--- a/third_party/sqlite/src/ext/fts5/test/fts5aux.test |
+++ b/third_party/sqlite/src/ext/fts5/test/fts5aux.test |
@@ -246,5 +246,37 @@ foreach {tn lRow res} { |
} $res |
} |
+#------------------------------------------------------------------------- |
+# Test the built-in bm25() demo. |
+# |
+reset_db |
+do_execsql_test 9.1 { |
+ CREATE VIRTUAL TABLE t1 USING fts5(a, b); |
+ INSERT INTO t1 VALUES('a', NULL); -- 1 |
+ INSERT INTO t1 VALUES('a', NULL); -- 2 |
+ INSERT INTO t1 VALUES('a', NULL); -- 3 |
+ INSERT INTO t1 VALUES('a', NULL); -- 4 |
+ INSERT INTO t1 VALUES('a', NULL); -- 5 |
+ INSERT INTO t1 VALUES('a', NULL); -- 6 |
+ INSERT INTO t1 VALUES('a', NULL); -- 7 |
+ INSERT INTO t1 VALUES('a', NULL); -- 8 |
+ INSERT INTO t1 VALUES(NULL, 'a a b'); -- 9 |
+ INSERT INTO t1 VALUES(NULL, 'b b a'); -- 10 |
+} |
+ |
+do_execsql_test 9.2 { |
+ SELECT rowid FROM t1('a AND b') ORDER BY rank; |
+} { |
+ 10 9 |
+} |
+ |
+do_execsql_test 9.3 { |
+ SELECT rowid FROM t1('b:a AND b:b') ORDER BY rank; |
+} { |
+ 9 10 |
+} |
+ |
+ |
+ |
finish_test |