# proc-that-elastic-loader

> Loader for proc-that. Loads processed items into an elasticsearch index.

Latest version **2.0.0** (published 2022-12-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install proc-that-elastic-loader
pnpm add proc-that-elastic-loader
yarn add proc-that-elastic-loader
bun add proc-that-elastic-loader
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2022-12-20 |
| First published | 2016-04-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=16 |
| Dependencies | 5 |
| Unpacked size | 11.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Christoph Bühler |
| Maintainers | smartive-ci, mfeltscher, petermanser, cbuehler, dwirz, deniaz, nmaro |
| Keywords | etl, node, typescript, proc-that, elastic, elasticsearch |

## Links

- npm: https://www.npmjs.com/package/proc-that-elastic-loader
- Repository: https://github.com/smartive/proc-that-elastic-loader
- Homepage: https://github.com/smartive/proc-that-elastic-loader#readme
- Issues: https://github.com/smartive/proc-that-elastic-loader/issues
- npm.io page: https://npm.io/package/proc-that-elastic-loader

## Dependencies (5)

- [rxjs](https://npm.io/package/rxjs.md) ^7.8.0
- [tslib](https://npm.io/package/tslib.md) ^2.4.1
- [proc-that](https://npm.io/package/proc-that.md) ^2.0.0
- [@types/node](https://npm.io/package/@types/node.md) ^18.11.17
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) ^8.5.0

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2022-12-20
- 1.0.1 — 2018-01-17
- 1.0.0 — 2017-11-06
- 0.5.0 — 2017-07-27
- 0.4.0 — 2016-07-19
- 0.3.2 — 2016-04-29
- 0.3.1 — 2016-04-07
- 0.3.0 — 2016-04-07
- 0.2.1 — 2016-04-07
- 0.2.0 — 2016-04-07
- 0.1.0 — 2016-04-01

## README

# ElasticLoader

Loader for `proc-that`. Loads processed items into an elasticsearch index.

##### A bunch of badges

[![Build Status](https://travis-ci.org/smartive/proc-that-elastic-loader.svg?maxAge=3600)](https://travis-ci.org/smartive/proc-that-elastic-loader)
[![Build Status](https://ci.appveyor.com/api/projects/status/382q34ka9its372v?svg=true)](https://ci.appveyor.com/project/buehler/proc-that-elastic-loader)
[![npm](https://img.shields.io/npm/v/proc-that-elastic-loader.svg?maxAge=3600)](https://www.npmjs.com/package/proc-that-elastic-loader)
[![Coverage status](https://img.shields.io/coveralls/smartive/proc-that-elastic-loader.svg?maxAge=3600)](https://coveralls.io/github/smartive/proc-that-elastic-loader)
[![license](https://img.shields.io/github/license/smartive/proc-that-elastic-loader.svg?maxAge=2592000)](https://github.com/smartive/proc-that-elastic-loader)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Greenkeeper badge](https://badges.greenkeeper.io/smartive/proc-that-elastic-loader.svg)](https://greenkeeper.io/)

## Installation

```bash
npm install --save proc-that-elastic-loader
```

## Usage

```typescript
import {Etl} from 'proc-that';
import {ElasticLoader} from 'proc-that-elastic-loader';

let loader = new ElasticLoader({/*es-config*/}, 'index', 'type');

new Etl().addLoader(loader).start().subscribe(/*...*/);
```

### Custom id selector

If your object does not have the property "id" or you need to select
a different property for item identification, you can set the last constructor
parameter `idSelector` and use a custom function.

```typescript
import {Etl} from 'proc-that';
import {ElasticLoader} from 'proc-that-elastic-loader';

let loader = new ElasticLoader({/*es-config*/}, 'index', 'type', o => true, obj => obj.notDefaultId);

new Etl().addLoader(loader).start().subscribe(/*...*/);
```

### Predicate

If you process multiple item types and your items are not stored
into the same index or the same index type, you can use the `predicate` param
to filter the items that are indexed by the loader. In the example below,
all items with `.type === 'Type1'` are only processed by `type1Loader`
 and vice versa.

```typescript
import {Etl} from 'proc-that';
import {ElasticLoader} from 'proc-that-elastic-loader';

let type1Loader = new ElasticLoader({/*es-config*/}, 'index', 'type_1', obj => obj.type === 'Type1');
let type2Loader = new ElasticLoader({/*es-config*/}, 'index', 'type_2', obj => obj.type === 'Type2');

new Etl().addLoader(type1Loader).addLoader(type2Loader).start().subscribe(/*...*/);
```

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