include_rank parameter for Table.search

* Add `include_rank` parameter to `Table.search`
* Test for .search(include_rank)
* Docs for table.search(include_rank)

https://github.com/simonw/sqlite-utils/pull/628

Refs #480

---------

Co-authored-by: Simon Willison <swillison@gmail.com>
This commit is contained in:
liunux4odoo 2024-11-24 04:34:27 +08:00 committed by GitHub
commit 7423296ec7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 33 additions and 0 deletions

View file

@ -2311,6 +2311,9 @@ The ``.search()`` method also accepts the following optional parameters:
``where_args`` dictionary
Arguments to use for ``:param`` placeholders in the extra WHERE clause
``include_rank`` bool
If set a ``rank`` column will be included with the BM25 ranking score - for FTS5 tables only.
``quote`` bool
Apply :ref:`FTS quoting rules <python_api_quote_fts>` to the search query, disabling advanced query syntax in a way that avoids surprising errors.