• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lucaong / minisearch / #436
99%
master: 99%

Build:
Build:
LAST BUILD BRANCH: refs/pull/303/merge
DEFAULT BRANCH: master
Ran 23 Nov 2022 11:57AM UTC
Jobs 1
Files 4
Run time –
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
#436

push

GitHub Actions

web-flow
Discard document as an alternative to remove (#183)

* Maintain mapping from ID to short ID

This speeds up removal, allows checking for duplicate IDs upon adding a
document, and prepares the ground to implement discarding documents by ID.

* Add discard method as an alternative to remove

The MiniSearch.discard method has the same visible effect of
MiniSearch.remove (both cause the document to stop appearing in search
results), but a different effect on the inverted index:

MiniSearch.remove takes as argument the full document, and removes it
from the inverted index, releasing memory immediately.

MiniSearch.discard instead only needs the document ID, and marks the
current version of the document as discarded so it is ignored in search
results. The inverted index is not modified though, so memory is not
released. Upon search, whenever a discarded ID is found, it is ignored,
and the inverted index for the search terms is cleaned up removing the
discarded documents.  This partially releases memory, but only for terms
that have been searched at least once after discarding the document.

* Implement MiniSearch.has method

To test if a document with the given ID was added to the index.

* Add cleanupDiscarded method to clean up index

This method traverses the inverted index in batches and cleans up
discarded documents.

* CLean up stored fields upon discard

* Auto vacuuming of discarded documents

* Add missing test

* Fix promise returned by vacuum when another vacuuming is in progress

* Improve documentation

* Change auto vacuum defaults and improve behavior

* Remove unnecessary default

* Fix and test a corner case with autovacuuming options

* Implement replace method

* Fix autovacuum behavior on multiple calls to discard

* Always apply broadest conditions to enqueued vacuum

* Fix issue when batch is bigger than number of documents

* Add termCount getter

* Make getDefault return autoVa... (continued)

212 of 218 branches covered (97.25%)

Branch coverage included in aggregate %.

130 of 130 new or added lines in 1 file covered. (100.0%)

665 of 665 relevant lines covered (100.0%)

715.31 hits per line

Jobs
ID Job ID Ran Files Coverage
1 #436.1 23 Nov 2022 11:57AM UTC 0
99.32
Source Files on build #436
Detailed source file information is not available for this build.
  • Back to Repo
  • f6408367 on github
  • Prev Build on refs/heads/master
  • Next Build on refs/heads/master
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc