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)