Skip to content

Commit

Permalink
Merge pull request #15 from voldern/deprecate
Browse files Browse the repository at this point in the history
Deprecate package
  • Loading branch information
voldern authored Sep 13, 2016
2 parents 154a474 + c5c5beb commit 1d6a733
Show file tree
Hide file tree
Showing 22 changed files with 6 additions and 889 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions .eslintrc

This file was deleted.

2 changes: 0 additions & 2 deletions .gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions .travis.yml

This file was deleted.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [2.0.0] - 2016-09-13

Renamed project to [elasticsearch-writable-stream](https://github.com/voldern/elasticsearch-writable-stream).

## [1.0.0] - 2016-08-18
### Added
- Make it possible to specify the bulk action
Expand Down
85 changes: 1 addition & 84 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,89 +1,6 @@
# elasticsearch-bulk-index-stream

A writable stream for bulk doing bulk actions, like indexing, in Elasticsearch.

[![build status](https://travis-ci.org/voldern/elasticsearch-bulk-index-stream.svg)](https://travis-ci.org/voldern/elasticsearch-bulk-index-stream)
[![modules status](https://david-dm.org/voldern/elasticsearch-bulk-index-stream.svg)](https://david-dm.org/voldern/elasticsearch-bulk-index-stream)

[![npm badge](https://nodei.co/npm/elasticsearch-bulk-index-stream.png?downloads=true)](https://nodei.co/npm/elasticsearch-bulk-index-stream)

# Usage

## Format

The records written to the stream has to have the following format:
```javascript
{
index: 'name-of-index',
type: 'recordType',
id: 'recordId',
parent: 'parentRecordType', // optional
action: 'update', // optional (default: 'index')
body: {
name: 'Foo Bar'
}
}
```

## Buffering

The `highWaterMark` option set on the stream defines how many items
will be buffered before doing a bulk operation. The stream will also
write all buffered items if its is closed, before emitting the
`finish` event.

## Flushing

Its also possible to send in the option `flushTimeout` to indicate
that the items currently in the buffer should be flushed after the
given amount of milliseconds if the `highWaterMark` haven't been
reached.

## Logging

A [bunyan](https://www.npmjs.com/package/bunyan),
[winston](https://www.npmjs.com/package/winston) or similar logger
instance that have methods like `debug`, `error` and `info` may be
sent in as `options.logger` to the constructor.

# Example

```javascript
var ElasticsearchBulkIndexStream = require('elasticsearch-bulk-index-stream');

var stream = new ElasticsearchBulkIndexStream(elasticsearchClient, {
highWaterMark: 256,
flushTimeout: 500
});

someInputStream
.pipe(stream)
.on('error', function(error) {
// Handle error
})
.on('finish', function() {
// Clean up Elasticsearch client?
})
```

# API

See [api.md](api.md).

# See

- [elasticsearch-streams](https://www.npmjs.com/package/elasticsearch-streams)

Elasticsearch readable and writable streams. The main difference
between the bulk writer in `elasticsearch-streams` and this library is
that this library requires the `index` and `type` of the data being
written to exist in the record instead of being set in a callback when
the records written.

`elasticsearch-streams` also implements its own event named `close` to
indicate that all the data has been written to Elasticsearch. This
will break modules like [pump](https://www.npmjs.com/package/pump)
that depend on the `finish` event.
This package has been renamed to [elasticsearch-writable-stream](https://github.com/voldern/elasticsearch-writable-stream).

# License

Expand Down
14 changes: 0 additions & 14 deletions api.md

This file was deleted.

258 changes: 0 additions & 258 deletions index.js

This file was deleted.

Loading

0 comments on commit 1d6a733

Please sign in to comment.