mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 01:14:31 +02:00
sqlite-utils optimize command, .optimize() and .detect_fts() table methods
This commit is contained in:
parent
015bd2a840
commit
0a8194e730
7 changed files with 146 additions and 4 deletions
|
|
@ -298,6 +298,25 @@ If you insert additional records into the table you will need to refresh the sea
|
|||
}, pk="id")
|
||||
dogs.populate_fts(["name", "twitter"])
|
||||
|
||||
``.enable_fts()`` defaults to using `FTS5 <https://www.sqlite.org/fts5.html>`__. If you wish to use `FTS4 <https://www.sqlite.org/fts3.html>`__ instead, use the following:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
dogs.enable_fts(["name", "twitter"], fts_version="FTS4")
|
||||
|
||||
Optimizing a full-text search table
|
||||
===================================
|
||||
|
||||
Once you have populated a FTS table you can optimize it to dramatically reduce its size like so:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
dogs.optimize()
|
||||
|
||||
This runs the following SQL::
|
||||
|
||||
INSERT INTO dogs_fts (dogs_fts) VALUES ("optimize");
|
||||
|
||||
Creating indexes
|
||||
================
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue