I have a Location entity which has a property of type org.springframework.data.elasticsearch.core.geo.GeoPoint in Spring boot and spring-data-elasticsearch project as below:
@Entity
@Table(name = "location")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@Document(indexName = "location")
public class Location implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@NotNull
@Column(name = "name", nullable = false)
private String name;
@NotNull
@Column(name = "country", nullable = false)
private String country;
@GeoPointField
private GeoPoint location;
...
But hibernate throws Caused by: org.hibernate.MappingException: Could not determine type for: org.springframework.data.elasticsearch.core.geo.GeoPoint when I start the application. Any way to get around this?
I used the
Stringrepresentation of the coordinates in the form"12.14, 34.53"(more here) with@GeoPointFieldannotation and that worked.