Skip to content

v5.3.0

Latest

Choose a tag to compare

@nticaric nticaric released this 11 Aug 20:53
· 3 commits to master since this release

Faster indexing and a couple of correctness fixes.

Performance

  • SQLite index creation is ~3× faster. saveWordlist() no longer inserts each term and catches a UNIQUE-constraint exception (re-preparing every statement per duplicate term); it uses a single INSERT … ON CONFLICT(term) DO UPDATE upsert and resolves term ids without SELECT MAX(id).
  • insert() is ~25× faster for large documents. Each document is now indexed inside a single transaction instead of one implicit commit (fsync) per wordlist/doclist write — so indexing e.g. a PDF per insert() call no longer pays thousands of fsyncs. (#360)

Fixed

  • total_documents was left at 0 when the number of indexed rows was an exact multiple of the 10,000-row commit batch, because the final transaction was left open and the info-table update rolled back. This corrupted BM25 idf = log(count / df) for such indexes.
  • MysqlEngine wordlist upsert accumulated num_hits using the document count instead of the hit count, giving multi-document terms the wrong total occurrence count.

Added

  • A benchmark/ harness (seeded Zipfian dataset generator + timers) for measuring index-creation speed.

Full Changelog: v5.2.0...v5.3.0