Elastic challenge is AngularJS SPA app with Node.js and Elasticsearch backend. It demonstrates simple functionality of importing .json data in Elastic via command line and building simple REST server for streaming the data to AngularJS front end.
This project is generated with yo angular generator version 0.14.0 and restify
brew install jq
sudo apt-get install jq
brew install elastic
Note: version 2.0.0_1 should be installed to support the backend queries
Download Node.js or verify if you have already installed it:
$ node -v
v5.1.0
Note: the project is build with Node.js v5.1.0
git clone https://github.com/j8/elastic-challenge.git
Install needed package dependancies
bower install && npm install
Note: books.josn was preformated in https://jsonformatter.curiousconcept.com to match RFC 4627
We need to import books.json file into Elasticsearch:
cat backend/books.json | jq -c '.[] | {"index": {"_index": "books", "_type": "book", "_id": .id}}, .' | curl -XPOST localhost:9200/_bulk --data-binary @-
Test if import is succesful by browsing to: http://localhost:9200/books/book/{id}
, for example http://localhost:9200/books/book/b334861393
elasticsearch
node server.js
grunt serve
TODO: Running grunt test
will run the unit tests with karma.
J8
MIT