How to setup a tokenizer in elasticsearch How to setup a tokenizer in elasticsearch elasticsearch elasticsearch

How to setup a tokenizer in elasticsearch


You can define mappings in the config files, but for most cases it is easier/more flexible to configure through the API. For example, this command will add a keyword/lowercase analyzer to the index test:

$ curl -XPUT localhost:9200/testindex/ -d '{  "settings":{     "index":{        "analysis":{           "analyzer":{              "analyzer_keyword":{                 "tokenizer":"keyword",                 "filter":"lowercase"              }           }        }     }  },  "mappings":{     "test":{        "properties":{           "title":{              "analyzer":"analyzer_keyword",              "type":"string"           }        }     }  }}'


To update an existing index, use

$ curl -XPUT localhost:9200/testindex/_settings -d '{..........}

However you can't update non dynamic settings.