# webhook-elastic-search

> Interface for interacting with the Elastic Search that backs a Webhook system.

Latest version **4.0.5** (published 2026-05-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install webhook-elastic-search
pnpm add webhook-elastic-search
yarn add webhook-elastic-search
bun add webhook-elastic-search
```

## Health

**Score 45/100 (D)** — status: active.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 4.0.5 |
| Published | 2026-05-11 |
| First published | 2017-04-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | rubenrodriguez |

## Links

- npm: https://www.npmjs.com/package/webhook-elastic-search
- npm.io page: https://npm.io/package/webhook-elastic-search

## Dependencies (2)

- [deep-equal](https://npm.io/package/deep-equal.md) ^1.0.1
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) ^8.14.0

## Recent versions

- 4.0.5 (latest) — 2026-05-11
- 4.0.4 — 2025-05-12
- 4.0.3 — 2024-12-09
- 4.0.1 — 2024-09-09
- 3.0.3 — 2023-05-11
- 3.0.2 — 2023-05-11
- 3.0.1 — 2023-01-08
- 3.0.0 — 2022-02-02
- 2.0.4 — 2019-02-21
- 2.0.2 — 2019-02-14
- 2.0.3 — 2019-02-14
- 2.0.1 — 2019-02-14
- 2.0.0 — 2019-02-07
- 1.1.0 — 2018-10-10
- 1.0.1 — 2017-04-13
- … 1 more at https://npm.io/package/webhook-elastic-search/versions

## README

# webhook-elastic-search

Interface for interacting with the Elastic Search that backs a Webhook system.

To install: `npm install webhook-elastic-search`

Example:

```
var elasticOptions = {
  node: elasticNode,
  auth: {
    apiKey: elasticApiKey,
  },
}

var elastic = WebHookElasticSearch(elasticOptions)

elastic.siteIndex(siteName)
  .then(siteIndex => console.log(siteIndex))
```

### API

`siteIndex(siteName) => Promise[siteIndex | error]` returns all documents in Elastic Search for the site. Where `siteName` is the Webhook site name. The promise returns `siteIndex`, an array of Elastic Search documents for the Webhook site.

`updateIndex({ siteName, siteData, siteIndex }) => Promise[results | error]` issues bulk commands that update the `siteIndex` to be in sync with the `siteData`. `siteData` is the current Firebase data node ( `/buckets/{site-name}/{site-key}/dev` ) for the Webhook site.

`indexSiteData({ siteName, siteData }) => Promise[results | error]` is a convenience method that runs `createIndex`, `siteIndex` & `updateIndex` for a given site. This will get you from nothing to complete usuable site index in one go.

`listIndicies({ verbose?, sort?, index? }) => Promise[indiciesTable | error]` returns `indicesTable`, a string that contains a table of indicies in the elastic cluster.

`createIndex({ siteName}) => Promise[results | error]` creates an index in the elastic cluster that can be used to store and query documents.

`deleteIndex({ siteName }) => Promise[results | error]` deletes an entire site index.

`queryIndex({ siteName, query, contentType?, page?, pageSize? }) => Promise[results | error]` returns the query results that match the query for the site index and optionally the specified content type.

`deleteDocument({ siteName, id }) => Promise[results | error]` deletes the document whose id matches for the given site.

`deleteContentType({ siteName, contentType }) => Promise[results | error]` delets all documents for the specified content type and site.

`indexDocument({ siteName, contentType, doc, id, oneOff? }) => Promise[results | error]` adds a document to the specified site index under the id and content type provided. Use the `oneOff` key to specify if the given content type is a one off.

### Test

Populate a `.env` file with the following environment variables:

```
ELASTIC_SEARCH_SERVER=
ELASTIC_SEARCH_USER=
ELASTIC_SEARCH_PASSWORD=
```

Run `npm test`

---
_Source: https://npm.io/package/webhook-elastic-search · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
