README.md

esta

Why?

Q: There is already an "official" ElasticSearch module, why create a new one...?
A: Have you triedusing the official client...? Did you enjoy the experience?

We needed an easy way to create, read, update and search our ElasticSearch
records from node.js. All the available modules were way too complicated
to use for beginners. So we decided to invest the time to create something
much simpler!

Creating a record in ElasticSearch from your node.js app using esta is this simple:

var es =require('esta'); // the simplest way to use ElasticSearch in node.js!es.create({'message':'ElasticSearch is awesome!'}, function(response){
console.log('record created '+response.created); // record created true
})

As you are about to discover, there is a much easier way to
use ElasticSearch!

The other obvious benefit of using Vagrant is that all your fellow developers
will have exactly the same (latest) build so there's no risk of version
incompatibility. Learn more at: https://github.com/nelsonic/learn-vagrant

I've included a Vagrantfile in this repo which will get you
up-and-running with Ubuntu, Node.js & ElasticSearch with a single command: vagrant up

all you need to do is run the following commands in your terminal:

vagrant up
vagrant ssh
sudo service elasticsearch start

If you have any questions, just ask!

Philosophy / Background / Detail

Why Create a New Library?

We wanted something simpler and thus much easier to extend if you need to!
esta is easy to understand. The entire module is 129 lines of clear/clean/commented/DRY code;
you can read & understand it all before breakfast!
Dive in at /lib. Each method has a corresponding file in /test

Practical Feature: Recover Accidentally Deleted Data

We wanted a way of
"soft-deleting"
records (i.e. avoiding data loss.)
If you like the idea of being able to * recover accidentally deleted data*,
you will love our DELETE method see: lib/delete.js

Our aim is to build something that only uses core modules with
Stable APIs,
so we never have to think about upgrading - it also makes it a
lot easier for others to learn how the module works, which
invites contribution from the community.
Given that ElasticSearch has a REST API we are only using Node's http (core) module.
and this is kept DRY (only in one file)
see: lib/http_request.js

ALLCAPS MEHTOD NAMES?

We prefer to have the METHOD names UPPERCASE
because it makes them easy to spot and differentiate from your code.
If you feel they are a bit "shouty"
all methods are available in lowercase too; take your pick!
see: http://git.io/pZ6t