2.0.0 • Published 1 year ago

proc-that-elastic-loader v2.0.0

Weekly downloads
14
License
MIT
Repository
github
Last release
1 year ago

ElasticLoader

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

A bunch of badges

Build Status Build Status npm Coverage status license semantic-release Greenkeeper badge

Installation

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

Usage

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.

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.

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(/*...*/);
2.0.0

1 year ago

1.0.1

6 years ago

1.0.0

7 years ago

0.5.0

7 years ago

0.4.0

8 years ago

0.3.2

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago