title: Spring Data Elasticsearch's @Field annotation not working
body: <p>I have a Spring Boot application with Spring Data Elasticsearch plugin in the pom.xml. I created a document class which i'd like to index:</p>
  
  <pre class="lang-java prettyprint-override"><code>@Document(indexName = "operations", type = "operation")
  public class OperationDocument {
  
  @Id
  private Long id;
  
  @Field(
      type = FieldType.String, 
      index = FieldIndex.analyzed, 
      searchAnalyzer = "standard", 
      indexAnalyzer = "standard",
      store = true
  )
  private String operationName;
  
  @Field(
      type = FieldType.Date, 
      index = FieldIndex.not_analyzed, 
      store = true, 
      format = DateFormat.custom, pattern = "dd.MM.yyyy hh:mm"
  )
  private Date dateUp;
  
  @Field(
      type = FieldType.String, 
      index = FieldIndex.not_analyzed, 
      store = false
  ) 
  private String someTransientData;
  
  @Field(type = FieldType.Nested)
  private List&lt;Sector&gt; sectors;
  
  //Getter and setters
  </code></pre>
  
  <p>I also created a repository for this class:</p>
  
  <pre class="lang-java prettyprint-override"><code> public interface OperationDocumentRepository 
        extends ElasticsearchRepository&lt;OperationDocument, Long&gt; {
   }
  </code></pre>
  
  <p>I made a test that indexes three sample objects using the repository. It's pretty long so I'll post it only is needed. The fact is that the mapping created in the ES server ignores configuration set by @Field annotations:</p>
  
  <pre><code>"mappings": {
    "operation": {
      "properties": {
        "operationName": {
          "type": "string"
        },
        "dateUp": {
          "type": "long"
        },
        "someTransientData": {
          "type": "string"
        },
        "sectors": {
          "properties": {
            "id": {
              "type": "long"
            },
            "sectorName": {
              "type": "string"
            }
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>There is no info about analyzers, "someTransientData" is stored and indexed, and dateUp is typed as Long instead of Date. </p>
  
  <p>A sample document requested directly from the server:</p>
  
  <pre><code> {
     "_index": "operations",
     "_type": "operation",
     "_id": "AUyUk2cY3nXeOFxdOlQW",
     "_version": 1,
     "_score": 1,
     "_source": {
       "id": null,
       "operationName": "Second Operation Name",
       "dateUp": 1428421827091,
       "someTransientData": "Do not index or store",
       "sectors": [
         {
           "id": 2,
           "sectorName": "Health Care"
         },
         {
           "id": 3,
           "sectorName": "Construction"
         }
       ]
     }
   }
  </code></pre>
  
  <p>I also noted that when I run the application for the second time, at startup time I get this error, only printed when the index already exists:</p>
  
  <blockquote>
    <p>ERROR 19452 --- [main] .d.e.r.s.AbstractElasticsearchRepository : failed to load elasticsearch nodes : org.elasticsearch.index.mapper.MergeMappingException: Merge failed with failures {[mapper [someTransientData] has different index values, mapper [someTransientData] has different tokenize values, mapper [someTransientData] has different index_analyzer, object mapping [sectors] can't be changed from non-nested to nested, mapper [operationName] has different store values, mapper [operationName] has different index_analyzer, mapper [dateUp] of different type, current_type [long], merged_type [date]]}</p>
  </blockquote>
  
  <p>It's this a bug of Spring Data Elastic Search or I'm doing something wrong?</p>
  
  <p>I tried the stable version provided by spring boot and last snapshot of spring-data-elasticsearch. I also tried the embedded Elasticsearch server provided by the plugin and an external one of the current version. I got always the same results.</p>