commit b5fe859d448849993a0ba2b72efff45dd308cd6f
parent 8ddb511c7be95e3b1bbb0c1b6944b38caecce09b
Author: Rene Wagner <rwa@clttr.info>
Date: Thu, 6 Apr 2023 18:35:28 +0000
param tweaks for whoosh and sqlite
Diffstat:
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/gus/build_index.py b/gus/build_index.py
@@ -152,7 +152,7 @@ AND (p.content_type NOT LIKE 'text/%'
OR (p.content_type LIKE 'text/%' AND p.size <= ?))""", constants.MAXIMUM_TEXT_PAGE_SIZE
)
- for page in pages.iterator():
+ for page in pages.__iter__():
index_page(index, page)
page.indexed_at = datetime.utcnow()
page.save()
diff --git a/gus/lib/db_model.py b/gus/lib/db_model.py
@@ -20,7 +20,8 @@ def init_db(filename=":memory:"):
models = [Link, Page, PageContent]
db = SqliteDatabase(filename, pragmas={
'journal_mode': 'wal',
- 'cache_size': -128 * 1000,
+ 'cache_size': -256 * 1000,
+ 'synchronous': 'normal',
'foreign_keys': 1,
'ignore_check_constraints': 0})
db.bind(models)
diff --git a/gus/lib/search.py b/gus/lib/search.py
@@ -77,7 +77,7 @@ class Index:
def _rolling_writer(self):
if not self._writer:
- self._writer = self._index.writer(limitmb=1024, procs=3, multisegment=self._destructive)
+ self._writer = self._index.writer(limitmb=2048, procs=2, multisegment=self._destructive)
return self._writer
def add_document(self, document):