title: Elastic Search - Pass Synonym while creating index
body: <p>I am trying to use the synonym feature in elastic search</p>
  
  <p>Below is my elastic search configuration </p>
  
  <pre><code>&lt;elasticsearch:node-client id="client" local="true"/&gt;
  
      &lt;bean name="elasticsearchTemplate" class="org.springframework.data.elasticsearch.core.ElasticsearchTemplate"&gt;
          &lt;constructor-arg name="client" ref="client"/&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>As per the documentation , it is mentioned to place the synonym file relative to the config directory of Elastic Search. </p>
  
  <p>But in my case I want to pass the synonym text programatically while creating the index.  The user will have option to add additional entries in the synonym file and application will refresh the index and analyze the data again using the updated synonym file</p>
  
  <p>While creating index , there is an option to pass settings</p>
  
  <pre><code>elasticSearchTemplate.createIndex(MyClass.class , Map settings )
  </code></pre>
  
  <p>eg: <code>elasticsearchTemplate.createIndex(Entity.class, "max_result_window = 15000");</code></p>
  
  <p>But the synonym setting is within the Analyzer module . </p>
  
  <p>Kindly revert back if this can be passed as settings while creating index</p>