Function remove

Removes the given document from the index.

The document to remove must NOT have changed between indexing and removal, otherwise the index will be corrupted.

This method requires passing the full document to be removed (not just the ID), and immediately removes the document from the inverted index, allowing memory to be released. A convenient alternative is discard, which needs only the document ID, and has the same visible effect, but delays cleaning up the index until the next vacuuming.

  • Type Parameters

    • ID

      The id type of the documents being indexed.

    • Document

      The type of the documents being indexed.

    • Index extends Record<string, any> = Record<never, never>

      The type of the documents being indexed.

    Parameters

    Returns void