I am using elastic search with hibernate search.I am having a requirement where I have to build tiles map in kibana.For that I need to have geo_point data with latitude and longitude value.I found in hibernate we have @spatial annotation to do this,but when I am using I am getting below exception.
java.lang.NullPointerException at org.hibernate.search.engine.metadata.impl.TypeMetadata$Builder.getAnalyzerReference(TypeMetadata.java:631)
I am having two model entity and I am writing it below.I am using hibernate search 5.7.0.Final.
@Entity
@Table(name = "actors", catalog = "twitter")
public class Actors implements java.io.Serializable {
Set<ActorsLocation> actorsLocation;
@OneToMany(fetch = FetchType.LAZY, mappedBy = "actors")
@Cascade(CascadeType.SAVE_UPDATE)
@IndexedEmbedded
public Set<ActorsLocation> getActorsLocation() {
return actorsLocation;
}
public void setActorsLocation(Set<ActorsLocation> actorsLocation) {
this.actorsLocation = actorsLocation;
}
}
@Entity
@Spatial
@Table(name = "actors_location", catalog = "twitter")
public class ActorsLocation implements java.io.Serializable {
private static final long serialVersionUID = 3585685166633868737L;
Long id;
@Id
@Column(name = "id",nullable = false)
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
@Latitude
@Field
Double lat;
@Longitude
@Field
Double lon;
@ContainedIn
Actors actors;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "user_id", nullable = false)
public Actors getActors() {
return actors;
}
public void setActors(Actors actors) {
this.actors = actors;
}
}
Any suggestion how to resolve it?