Skip to main content

Deleting a Document

Managing your index's data is an essential part of maintaining a well-organized and up-to-date search experience. HoppySearch offers a simple method to delete a particular document from your index. This allows you to remove outdated or irrelevant information effortlessly.

Follow the instructions below to delete a specific document from your HoppySearch index:

How to Delete a Document

  1. Initial Configuration:

    1. Before you can delete a document, ensure you have configured your HoppySearch client as detailed in the initial setup documentation.
  2. Delete Specific Data:

    1. To delete a specific document from your index, use the following code:

      hs_guid = "15b522d8-1545-4dc9-9160-0b512f7d6997"
      optionals = {
      diag: true,
      showStats: true
      }
      hoppysearch.delete(hs_guid, optionals)
      .then(res => {
      console.log('statusCode:', res.status);
      console.log('response text:', res.body);
      })
      .catch(err => {
      console.log(err)
      })
    2. hs_guid: The unique identifier (GUID) of the document you want to delete. This ensures that the correct document is removed from your index.

    3. diag:

      1. true: Allows you to see extra diagnostics records.
      2. false: Omits diagnostics records.
    4. showStats:

      1. true: Provides statistics about the deletion operation.
      2. false: Excludes statistics.

The second argument of hoppysearch.delete is not mandatory. You can customize your deletion operation according to your specific needs.


By following these steps, you can easily delete a specific document from your HoppySearch index. This feature empowers you to maintain the relevance and accuracy of your indexed data.