See the doc:app-search app documentation for python code.

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


Create a search sls:

# config/search.sls

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

# top.sls
  - config.search
  - sites.my


For a development workstation, see elasticsearch.

Install the phoentic search plugins (See Plugins, Re-Install below).



Elasticsearch version 6 (and later):

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


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


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


Older versions of elasticsearch (version 5 and earlier) the plugin maintenance program was called plugin not elasticsearch-plugin.


cd /usr/share/elasticsearch
bin/plugin list

Background Tasks

See doc:app-search


I couldn’t upgrade from an old version to 8.x and didn’t need to preserve the data, so I deleted the data folder:

  1. apt remove elasticsearch

  2. Find the location of the data folder in /etc/elasticsearch/elasticsearch.yml

  3. Delete the folder.

  4. apt install elasticsearch

  5. Recreate the Elasticsearch indexes.

Update to version 6

No handler for type [string]

From No handler for type [string] declared on field [name]

Elasticsearch has dropped the string type and is now using text, so your code should be something like this:

'mappings': {
    self.DOC_TYPE: {
        "properties": {
            "job_role": {
                "type": "text",
                "analyzer": "my_analyzer",


If you cannot install a plugin because a previous version is still installed, then remove ElasticSearch before re-installing.

Will not start (after installing an earlier version)

Check the logs in:


It seems that the config is driven from:


To solve this issue I ran the following commands:

apt purge elasticsearch
rm -r /var/lib/elasticsearch/