diff --git a/docs/cli.rst b/docs/cli.rst index 6597fb6..b67fbf9 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -379,6 +379,10 @@ The ``enable-fts`` command will populate the new index with all existing documen $ sqlite-utils populate-fts mydb.db documents title summary +A better solution here is to use database triggers. You can set up database triggers to automatically update the full-text index using the ``--create-triggers`` option when you first run ``enable-fts``:: + + $ sqlite-utils enable-fts mydb.db documents title summary --create-triggers + Vacuum ====== diff --git a/docs/python-api.rst b/docs/python-api.rst index 997bd97..572e330 100644 --- a/docs/python-api.rst +++ b/docs/python-api.rst @@ -907,6 +907,12 @@ If you insert additional records into the table you will need to refresh the sea }, pk="id") dogs.populate_fts(["name", "twitter"]) +A better solution is to use database triggers. You can set up database triggers to automatically update the full-text index using ``create_triggers=True``: + +.. code-block:: python + + dogs.enable_fts(["name", "twitter"], create_triggers=True) + ``.enable_fts()`` defaults to using `FTS5 `__. If you wish to use `FTS4 `__ instead, use the following: .. code-block:: python