.optimize() no longer cleans up _docsize

This isn't necessary any more since the new .rebuild_fts()
method can achieve the same thing.

Refs #155, #153
This commit is contained in:
Simon Willison 2020-09-08 15:18:12 -07:00
commit 64799df78b
4 changed files with 22 additions and 38 deletions

View file

@ -951,20 +951,6 @@ class Table(Queryable):
table=fts_table
)
)
self.db.execute(
textwrap.dedent(
"""
DELETE FROM [{table}_docsize] WHERE {column} NOT IN (
SELECT rowid FROM [{table}]);
"""
)
.strip()
.format(
# FTS5 uses 'id' but FTS4 uses 'docid'
column=self.db["{}_docsize".format(fts_table)].columns[0].name,
table=fts_table,
)
)
return self
def search(self, q):