# Problem with ElasticsearchRepository

**URL:** <https://discuss.elastic.co/t/problem-with-elasticsearchrepository/270690>\
**Category:** Elasticsearch\
**Created:** [April 20, 2021, 10:42am UTC](https://discuss.elastic.co/t/problem-with-elasticsearchrepository/270690 "2021-04-20T10:42:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Atiqur\_Rahman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/atiqur_rahman/32/78248_2.png) [@Atiqur\_Rahman](https://discuss.elastic.co/u/Atiqur_Rahman)\
**Post date:** [April 20, 2021, 10:42am UTC](https://discuss.elastic.co/t/problem-with-elasticsearchrepository/270690/1 "2021-04-20T10:42:49Z")

</div>

Hi All I am not sure if this is the right place to ask this question.  
I am using Elasticsearch 7.11 and Spring-Boot 2.4.4

import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;  
import org.springframework.stereotype.Repository;  
import uk.co.wowcher.ingest.repository.elasticsearch.model.LocationDocument;

@Repository  
public interface rep extends ElasticsearchRepository\<LocationDocument, Long\> {  
}

here is the document mapping

@Data  
@Builder  
@NoArgsConstructor  
@AllArgsConstructor  
@Document(indexName = "location", createIndex = false)  
@JsonIgnoreProperties(ignoreUnknown = true)  
public class LocationDocument {  
@Id  
public Long id;  
public LatLon latLon;  
}

@Data  
@NoArgsConstructor  
@AllArgsConstructor  
@Builder  
public class LatLon {

```
private Float lat;
private Float lon;

```

}

If I save the content in elasticsearch as rep.save( single object) no issue  
But if I try to save as rep.saveAll(List) then it keep throwning the following error

org.springframework.data.elasticsearch.BulkFailureException: Bulk operation has failures. Use ElasticsearchException.getFailedDocuments() for detailed messages [{276158=ElasticsearchException[Elasticsearch exception [type=mapper\_parsing\_exception, reason=failed to parse field [latLon] of type [geo\_point]]]; nested: ElasticsearchException[Elasticsearch exception [type=parse\_exception, reason=field [lat] missing]];, 277009=ElasticsearchException[Elasticsearch exception [type=mapper\_parsing\_exception, reason=failed to parse field [latLon] of type [geo\_point]]]; nested: ElasticsearchException[Elasticsearch exception [type=parse\_exception, reason=field [lat] missing]];, 276669=ElasticsearchException[Elasticsearch exception [type=mapper\_parsing\_exception, reason=failed to parse field [latLon] of type [geo\_point]]]; nested: ElasticsearchException[Elasticsearch exception [type=parse\_exception, reason=field [lat] missing]];, 276582=ElasticsearchException[Elasticsearch exception [type=mapper\_parsing\_exception, reason=failed to parse field [latLon] of type [geo\_point]]]; nested: ElasticsearchException[Elasticsearch exception [type=parse\_exception, reason=field [lat] missing]];, 277011=ElasticsearchException[Elasticsearch exception [type=mapper\_parsing\_exception, reason=failed to parse field [latLon] of type [geo\_point]]]; nested: ElasticsearchException[Elasticsearch exception [type=parse\_exception, reason=field [lat] missing]];, 277010=ElasticsearchException[Elasticsearch exception [type=mapper\_parsing\_exception, reason=failed to parse field [latLon] of type [geo\_point]]]; nested: ElasticsearchException[Elasticsearch exception [type=parse\_exception, reason=field [lat] missing]];, 275849=ElasticsearchException[Elasticsearch exception [type=mapper\_parsing\_exception, reason=failed to parse field [latLon] of type [geo\_point]]]; nested: ElasticsearchException[Elasticsearch exception [type=parse\_exception, reason=field [lat] missing]];}]  
at org.springframework.data.elasticsearch.core.AbstractElasticsearchTemplate.checkForBulkOperationFailure(AbstractElasticsearchTemplate.java:529)  
at org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.doBulkOperation(ElasticsearchRestTemplate.java:228)  
at org.springframework.data.elasticsearch.core.AbstractElasticsearchTemplate.bulkOperation(AbstractElasticsearchTemplate.java:302)  
at org.springframework.data.elasticsearch.core.AbstractElasticsearchTemplate.bulkIndex(AbstractElasticsearchTemplate.java:286)

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 20, 2021, 11:00am UTC](https://discuss.elastic.co/t/problem-with-elasticsearchrepository/270690/2 "2021-04-20T11:00:28Z")

</div>

Welcome!

Please format your code, logs or configuration files using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and not the citation button. It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

This is the icon to use if you are not using markdown format:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/e/7e6e239431ec2d71cbf1beef741f2e93e7cc762c.jpg)

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.  
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.  
Please update your post.

Here is what I've been doing:

> <https://github.com/dadoonet/legacy-search/blob/907fcb4b1be169f0befde24a3395b4010c3e8a8d/src/main/java/fr/pilato/demo/legacysearch/domain/Address.java#L28-L39>

And

> <https://github.com/dadoonet/legacy-search/blob/907fcb4b1be169f0befde24a3395b4010c3e8a8d/src/main/java/fr/pilato/demo/legacysearch/domain/GeoPoint.java#L25-L28>

Any chance you can debug this and see what is actually sent as a json document to elasticsearch?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 18, 2021, 11:00am UTC](https://discuss.elastic.co/t/problem-with-elasticsearchrepository/270690/3 "2021-05-18T11:00:58Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
