This commit is contained in:
Kovid Goyal 2022-05-04 21:43:17 +05:30
parent 013018f105
commit 0a6dc87fcd
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -143,7 +143,7 @@ class FTS:
text = 'books_text.searchable_text' text = 'books_text.searchable_text'
if highlight_start is not None and highlight_end is not None: if highlight_start is not None and highlight_end is not None:
if snippet_size is not None: if snippet_size is not None:
text = f'snippet({fts_table}, 0, "{highlight_start}", "{highlight_end}", "", {max(1, min(snippet_size, 64))})' text = f'snippet("{fts_table}", 0, "{highlight_start}", "{highlight_end}", "", {max(1, min(snippet_size, 64))})'
else: else:
text = f'highlight("{fts_table}", 0, "{highlight_start}", "{highlight_end}")' text = f'highlight("{fts_table}", 0, "{highlight_start}", "{highlight_end}")'
query = 'SELECT {0}.id, {0}.book, {0}.format, {1} FROM {0} ' query = 'SELECT {0}.id, {0}.book, {0}.format, {1} FROM {0} '