ElasticSearch: Up and Running in under 20 minutes

This is a quick post about getting implementations of ElasticSearch up and running in under 20 minutes, assuming you are using OS X.

1) Install ElasticSearch.

Make sure you have Java 8 installed. Check your Java version by running java -version. Install Java 8 from this download.

To install ElasticSearch, run the following: brew install elasticsearch

If you do not have Homebrew installed, go ahead and install it here.

After this, go ahead and run elasticsearch in the console.

2) Run a command

rails new searchapp --skip --skip-bundle --template https://raw.github.com/elastic/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/01-basic.rb for a basic setup demo

3) Run a long command

rails new searchapp --skip --skip-bundle --template https://raw.github.com/elastic/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/02-pretty.rb in the same folder as the other project to see Bootstrap styles added, result highlighting etc.

4) Run another long command

rails new searchapp --skip --skip-bundle --template https://raw.github.com/elastic/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/03-expert.rb in the same folder to see a use case with a couple of hundred NYTimes articles.

In order to run the last one, you need to be running a Redis server concurrently with the rails server and elasticsearch.

Resources

See Redis quickstart here. See ElasticSearch-Model gem github here. See ElasticSearch-Rails gem github here.

Published 26 Jun 2018

founder && full stack && ethereum developer.
Max Goodman on Twitter