title: spring+elaticsearch @Document annotation，shards attribute dynamic assignment
body: <p>I have a 10 billion data, and now I have to divide it into 12 indexes by month, so if you use springboot+spring-boot-starter-data-elasticsearch, @Document annotated indexName, shards must implement dynamic assignment, now indexName is OK Dynamic assignment, as shown in the following code:</p>
  
  <pre><code>@Bean
  public DocumentConfig documentConfig() {
      return new DocumentConfig();
  }
  
  @Document(
           indexName = "#{documentConfig.getIndexName() == 
               null?'jan':documentConfig.getIndexName()}",
            type = "_doc",
            shards = 3,
            replicas = 1
       )
  </code></pre>
  
  <p>and Switch index like this:</p>
  
  <pre><code>documentConfig.setIndexName(name);
  es.save(obj);
  </code></pre>
  
  <p>But when I create a new index, shards will become the default value of 5.
  When I try to change it dynamically like the following code, it gives an error:Type mismatch: cannot convert from String to short</p>
  
  <pre><code>shards = "#{documentConfig.getShards() == null? 
      3:documentConfig.getShards()}"
  </code></pre>
  
  <p>How to deal with it? Thank you</p>