title: spring-data-elasticsearch - Jackson can't serialize using global configuration
body: <p>I'm developing a project using ElasticSearch and I'm having some problems with serialization/deserialization with Jackson. My project was created using JHipster, so, I'm using spring to store my entity to the database and to index in ElasticSearch. All entities and other objects can be (de)serialized with Jackson, except when I try to add it to ES.
  This is my global configuration for Jackson:</p>
  
  <pre><code>@Configuration
  public class JacksonConfiguration {
  
      @Bean
      Jackson2ObjectMapperBuilder jackson2ObjectMapperBuilder() {
          SimpleModule timeModule = new JavaTimeModule();
          timeModule.addSerializer(OffsetDateTime.class, JSR310DateTimeSerializer.INSTANCE);
          timeModule.addSerializer(ZonedDateTime.class, JSR310DateTimeSerializer.INSTANCE);
          timeModule.addSerializer(LocalDateTime.class, JSR310DateTimeSerializer.INSTANCE);
          timeModule.addSerializer(Instant.class, JSR310DateTimeSerializer.INSTANCE);
          timeModule.addDeserializer(LocalDate.class, JSR310LocalDateDeserializer.INSTANCE);
          SimpleModule geoModule=new GeoModule();
          geoModule.addSerializer(Point.class, PointSerializer.INSTANCE);
          geoModule.addDeserializer(Point.class, PointDeserializer.INSTANCE);
          return new Jackson2ObjectMapperBuilder()
              .featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
              .findModulesViaServiceLoader(true)
              .modulesToInstall(timeModule,geoModule);
      }
  }
  </code></pre>
  
  <p>This configuration works fine, except when I try add an entity to ES, for example, <code>PointSerializer</code> is never called. The only way I can see this serializer running (and consequently indexing correctly) for ES is adding <code>@JsonSerialize(using = PointSerializer.class)</code> to the field. Why is it happening and how can I configure it globally?</p>