title: Elasticsearch and Spring Data: how to reindex with alias
body: <p>I have a bean annotated as such:</p>
  
  <pre><code>@Document(indexName = "foo", type = "bar")
  public class BarEntity {
      private String someField = "";
  }
  </code></pre>
  
  <p>"foo" is an alias in elasticsearch to foo-2016-11-04:</p>
  
  <pre><code>"foo-2016.11.04" : {
    "aliases" : {
      "foo" : { }
    }
  }
  </code></pre>
  
  <p>What I want to do is change someField's indexing to not_analyzed:</p>
  
  <pre><code>@Document(indexName = "foo", type = "bar")
  public class BarEntity {
      @Field(index = FieldIndex.not_analyzed, type = FieldType.String)
      private String someField = "";
  }
  </code></pre>
  
  <p>As far as I can tell, I'll have to create a new index and point the alias to that, e.g. foo-2016.11.29.<br/><br/>How can I do this in elasticeseach 2.3 with Spring Data?
  My bean is linked to the alias, and Spring Data would create the correct index automatically I guess.<br/>I just don't know how to make it create the index via an alias.<br/><br/>
  Do I first reindex foo-2016.11.04 to foo-2016.11.29, update the alias to point to the new one and just redeploy the spring app, or is there something else to be done here?</p>