title: ElasticSearch Global Analyzer
body: <p>I want to define a global analyzer in ElasticSearch. I edited the configuration file of ES (elasticsearch.yml)  </p>
  
  <pre><code>index :
     analysis :        
        analyzer :            
           myTestAnalyzer :                
              type : standard
              max_token_length : 50 
  </code></pre>
  
  <p>and restarted the service.</p>
  
  <p>When i run in Sense</p>
  
  <pre><code>GET /_analyze?analyzer=myTestAnalyzer
  {"This is a test"}
  </code></pre>
  
  <p>I get </p>
  
  <p>{
     "error": "ElasticsearchIllegalArgumentException[failed to find analyzer [myTestAnalyzer]]",
     "status": 400
  }</p>
  
  <p>I have read in another post (<a href="https://stackoverflow.com/questions/16913073/define-analyzer-globally-es">define analyzer globally (ES)</a>) that I need to create a mapping that uses the analyzer and then use that index in the analyzer call. </p>
  
  <p>Can you please give me an example how to do that.</p>
  
  <p>Thank you</p>