I have a spring data elastic search document as follows :
@Document(indexName = "outlet")
public class OutletIndex implements IESMapper{
@Id
private String name;
private Long outletId;
private OutletType type;
private String address;
private String geoLocation;
private String city;
// getter and setter methods
}
Can I make the combination of city
and name
field unique? In spring data jpa we can use @UniqueConstraint
option(How to introduce multi-column constraint with JPA annotations?). Is there any way to implement it in Spring data ES?