Skip to content

Commit 1fa5a12

Browse files
committed
Documentation for db.quote_fts(), refs #246
1 parent e6b1022 commit 1fa5a12

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docs/python-api.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1909,6 +1909,18 @@ To remove the FTS tables and triggers you created, use the ``disable_fts()`` tab
19091909
19101910
db["dogs"].disable_fts()
19111911
1912+
.. _python_api_quote_fts:
1913+
1914+
Quoting characters for use in search
1915+
------------------------------------
1916+
1917+
SQLite supports `advanced search query syntax <https://www.sqlite.org/fts3.html#full_text_index_queries>`__. In some situations you may wish to disable this, since characters such as ``.`` may have special meaning that causes errors when searching for strings provided by your users.
1918+
1919+
The ``db.quote_fts(query)`` method returns the query with SQLite full-text search quoting applied such that the query should be safe to use in a search::
1920+
1921+
db.quote_fts("Search term.")
1922+
# Returns: '"Search" "term."'
1923+
19121924
.. _python_api_fts_search:
19131925
19141926
Searching with table.search()

0 commit comments

Comments
 (0)