ElasticSearch

For building the fuzzy match code, I found the following articles very useful:

Pillar

Create a search sls:

# config/search.sls
search:
  True

And add it to the config for the server e.g:

# top.sls
'test-a':
  - config.search
  - sites.my

Install

For a development workstation:

sudo wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -

sudo echo "deb http://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list

sudo apt-get update
sudo apt-get install elasticsearch
sudo service elasticsearch start

Install the phoentic search plugins:

sudo -i
cd /usr/share/elasticsearch/
bin/plugin install analysis-phonetic

service elasticsearch restart

Tip

For more information on the Phonetic Plugins, see Custom Analyzers and Phonetic Analysis Plugin

Warning

The plugins will not update when a new version of ElasticSearch is installed by apt-get.

Re-Install plugins

From the Salt state, search/init.sls:

cd /usr/share/elasticsearch
bin/plugin remove analysis-phonetic
bin/plugin install analysis-phonetic
service elasticsearch restart

List installed plugins

cd /usr/share/elasticsearch
bin/plugin list