# Update repos
#
sudo apt update
sudo apt install --only-upgrade -y \
gcc-5-base \
libstdc++6
# Tools
#
During installation, create a user called admin
rather than one with your own name.
Then install Homebrew as per latest instructions (note that this will install the necessary CLI components for XCode):
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add a reference to the remote repo: | |
# | |
git remote add ajax-solr git://github.com/evolvingweb/ajax-solr | |
# Get the objects from the repo: | |
# | |
git fetch ajax-solr | |
# Create a branch that tracks the remote master branch: | |
# | |
git checkout -b ajax-solr ajax-solr/master | |
# Switch back to our own master and pull the code into a sub-directory: |
I hereby claim:
- I am markbirbeck on github.
- I am markbirbeck (https://keybase.io/markbirbeck) on keybase.
- I have a public key ASBaGjQr-TzHG1tU2ciXqbwppkrYU98qgj385aq7sRQ9Ago
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const stream = require('stream') | |
class ElasticSearchWritableStream extends stream.Writable { | |
constructor(config, options) { | |
super(options) | |
this.config = config | |
/** | |
* Create the ElasticSearch client: | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ElasticSearchWritableStream extends stream.Writable { | |
constructor(config, options) { | |
super(options) | |
this.config = config | |
/** | |
* Create the ElasticSearch client: | |
*/ | |
this.client = new elasticsearch.Client({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const stream = require('stream') | |
const elasticsearch = require('elasticsearch') | |
class ElasticSearchWritableStream extends stream.Writable { | |
constructor(config) { | |
super() | |
this.config = config | |
/** | |
* Create the ElasticSearch client: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ElasticSearchWritableStream extends stream.Writable { | |
... | |
async _writev(chunks, next) { | |
const body = chunks | |
.map(chunk => chunk.chunk) | |
.reduce((arr, obj) => { | |
/** | |
* Each entry to the bulk API comprises an instruction (like 'index' | |
* or 'delete') and some data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ElasticSearchWritableStream extends stream.Writable { | |
constructor(config) { | |
... | |
} | |
/** | |
* When writing a single record, we use the index() method of | |
* the ES API: | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const stream = require('stream') | |
class ElasticSearchWritableStream extends stream.Writable { | |
} | |
module.exports = ElasticSearchWritableStream |
NewerOlder