mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 09:24:31 +02:00
Added test for sqlite-utils search, refs #192
This commit is contained in:
parent
d411fba1f4
commit
63e2bdf18d
4 changed files with 36 additions and 3 deletions
|
|
@ -941,6 +941,7 @@ def query(
|
|||
"Execute SQL query and return the results as JSON"
|
||||
db = sqlite_utils.Database(path)
|
||||
_load_extensions(db, load_extension)
|
||||
db.register_fts4_bm25()
|
||||
with db.conn:
|
||||
cursor = db.execute(sql, dict(param))
|
||||
if cursor.description is None:
|
||||
|
|
|
|||
|
|
@ -1360,7 +1360,7 @@ class Table(Queryable):
|
|||
rank_implementation = "[{}].rank".format(fts_table)
|
||||
else:
|
||||
self.db.register_fts4_bm25()
|
||||
rank_implementation = "-rank_bm25(matchinfo([{}], 'pcnalx'))".format(
|
||||
rank_implementation = "rank_bm25(matchinfo([{}], 'pcnalx'))".format(
|
||||
fts_table
|
||||
)
|
||||
return sql.format(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue