# @seedalpha/elastic-index

> ElasticSearch index management

Latest version **3.2.11** (published 2020-02-16) · ©2014 Seedalpha license · 0 weekly downloads

## Install

```sh
npm install @seedalpha/elastic-index
pnpm add @seedalpha/elastic-index
yarn add @seedalpha/elastic-index
bun add @seedalpha/elastic-index
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.2.11 |
| Published | 2020-02-16 |
| First published | 2020-01-18 |
| Weekly downloads | 0 |
| License | ©2014 Seedalpha |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Vladimir Popov |
| Maintainers | ac_inc, tom.raggett.trcuk.com |
| Keywords | elasticsearch, index |

## Links

- npm: https://www.npmjs.com/package/@seedalpha/elastic-index
- Repository: https://github.com/%3Aseedalpha/elastic-index
- Homepage: https://github.com/seedalpha/elastic-index
- Issues: https://github.com/seedalpha/elastic-index/issues
- npm.io page: https://npm.io/package/@seedalpha/elastic-index

## Dependencies (1)

- [superagent](https://npm.io/package/superagent.md) ^0.18.2

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 3.2.11 (latest) — 2020-02-16
- 3.2.10 — 2020-01-18

## README

# ElasticIndex

ElasticSearch index management library

### Changelog

`3.2.0`:

- explicit options
- documentation

`3.1.0`:

- handle `noop` cases, e.g. `esIndex.index(doc._id, doc);`

`3.0.0`:

- move index `type` (name) to options
- remove `debug` option
- use `visionmedia/debug`

`2.0.0`:

- get read of too specific env variables
- use elastic search connection string instead of host/port pair

### Prerequisites

    $ npm set registry http://npm.sandbox.elasticseed.net
    $ npm set always-auth true
    $ npm login

### Installation

    $ npm install elastic-index --save

### Usage
    
    // index.js
    var ElasticIndex = require('elastic-index');
    
    var bookIndex = new ElasticIndex({
      type: 'books',
      index: 'development',
      url: 'https://username:password@host:port'
    });
    
    bookIndex.index('1', { name: 'War and Peace' }, function(error) {
      if (!error) console.log('Book indexed');
    });

    bookIndex.unindex('1', function(error) {
      if (!error) return console.log('Book removed from index);
    });

    // abstract
    var index = new ElasticIndex(options);

- `type {String}`, elasticsearch type
- `index {String}`, elasticsearch index
- `url {String}`, elasticsearch url, default `'http://localhost:9200'`

### Debug

    $ DEBUG=elastic-index npm test

### Development

    $ git clone git@github.com:seedalpha/elastic-index.git
    $ cd elastic-index
    $ npm install
    $ ES_URL=${ELASTIC_SEARCH_URL} npm test                # to run on mongohq elasticsearch instance (staging)
    $ ES_URL=${ELASTIC_SEARCH_URL} NOCK_OFF=true npm test  # to mock requests and run locally

### Author

Vladimir Popov <vlad@seedalpha.net>

### License

©2014 Seedalpha

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