OLD | NEW |
1 # 2014 Dec 20 | 1 # 2014 Dec 20 |
2 # | 2 # |
3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
5 # | 5 # |
6 # May you do good and not evil. | 6 # May you do good and not evil. |
7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
9 # | 9 # |
10 #*********************************************************************** | 10 #*********************************************************************** |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 3 {"a a d"} {"[a] [a] d"} | 239 3 {"a a d"} {"[a] [a] d"} |
240 } { | 240 } { |
241 execsql { DELETE FROM x1 } | 241 execsql { DELETE FROM x1 } |
242 foreach row $lRow { execsql { INSERT INTO x1 VALUES($row) } } | 242 foreach row $lRow { execsql { INSERT INTO x1 VALUES($row) } } |
243 breakpoint | 243 breakpoint |
244 do_execsql_test 8.$tn { | 244 do_execsql_test 8.$tn { |
245 SELECT highlight(x1, 0, '[', ']') FROM x1 WHERE x1 MATCH 'a OR (b AND d)'; | 245 SELECT highlight(x1, 0, '[', ']') FROM x1 WHERE x1 MATCH 'a OR (b AND d)'; |
246 } $res | 246 } $res |
247 } | 247 } |
248 | 248 |
| 249 #------------------------------------------------------------------------- |
| 250 # Test the built-in bm25() demo. |
| 251 # |
| 252 reset_db |
| 253 do_execsql_test 9.1 { |
| 254 CREATE VIRTUAL TABLE t1 USING fts5(a, b); |
| 255 INSERT INTO t1 VALUES('a', NULL); -- 1 |
| 256 INSERT INTO t1 VALUES('a', NULL); -- 2 |
| 257 INSERT INTO t1 VALUES('a', NULL); -- 3 |
| 258 INSERT INTO t1 VALUES('a', NULL); -- 4 |
| 259 INSERT INTO t1 VALUES('a', NULL); -- 5 |
| 260 INSERT INTO t1 VALUES('a', NULL); -- 6 |
| 261 INSERT INTO t1 VALUES('a', NULL); -- 7 |
| 262 INSERT INTO t1 VALUES('a', NULL); -- 8 |
| 263 INSERT INTO t1 VALUES(NULL, 'a a b'); -- 9 |
| 264 INSERT INTO t1 VALUES(NULL, 'b b a'); -- 10 |
| 265 } |
| 266 |
| 267 do_execsql_test 9.2 { |
| 268 SELECT rowid FROM t1('a AND b') ORDER BY rank; |
| 269 } { |
| 270 10 9 |
| 271 } |
| 272 |
| 273 do_execsql_test 9.3 { |
| 274 SELECT rowid FROM t1('b:a AND b:b') ORDER BY rank; |
| 275 } { |
| 276 9 10 |
| 277 } |
| 278 |
| 279 |
| 280 |
249 finish_test | 281 finish_test |
250 | 282 |
OLD | NEW |