mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-24 19:04:12 +02:00
add test
This commit is contained in:
parent
d40df56acc
commit
b1b9b0aa5a
1 changed files with 21 additions and 0 deletions
|
|
@ -556,6 +556,27 @@ def test_enable_fts_error_message_on_views():
|
||||||
" rank_bm25(matchinfo([books_fts], 'pcnalx'))"
|
" rank_bm25(matchinfo([books_fts], 'pcnalx'))"
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
{'include_rank': True},
|
||||||
|
"FTS5",
|
||||||
|
(
|
||||||
|
"with original as (\n"
|
||||||
|
" select\n"
|
||||||
|
" rowid,\n"
|
||||||
|
" *\n"
|
||||||
|
" from [books]\n"
|
||||||
|
")\n"
|
||||||
|
"select\n"
|
||||||
|
" [original].*,\n [books_fts].rank rank\n"
|
||||||
|
"from\n"
|
||||||
|
" [original]\n"
|
||||||
|
" join [books_fts] on [original].rowid = [books_fts].rowid\n"
|
||||||
|
"where\n"
|
||||||
|
" [books_fts] match :query\n"
|
||||||
|
"order by\n"
|
||||||
|
" [books_fts].rank"
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
def test_search_sql(kwargs, fts, expected):
|
def test_search_sql(kwargs, fts, expected):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue