我有1个索引,2种类型。 /spring-boot-1.3.3 /
@Document(indexName = "main", type = "item")
@Entity
public class Item {
private Long id;
private String name;
@ManyToOne
private User owner;
}
如何忽略userData字段仅用于类型:“item”
@Document(indexName = "main", type = "user")
@Entity
public class User {
private Long id;
private String userName;
//@JsonIgnore <- ignored for both types, if i add this annotation
private UserData userData; // must be ignored for elastic type: "item"
}