Spring Data Elasticsearch使用String作为标识

时间:2016-11-10 10:25:29

标签: spring elasticsearch

当我使用Spring Data Elasticsearch时:

@Document(indexName = "app_rec_by_content_1", type = "user_rec")

public class UserRec {
    @Id
    public String id;
    public int userid;
    public int iid;
    public int modelid;
    public Date timestamp;
} 

我有一个例外:

  

线程中的异常" pool-3-thread-1" MapperParsingException [无法解析[id]];嵌套:NumberFormatException [对于输入字符串:" 1-245"];

Dose Spring Data Elasticsearch支持String字段为@id?

0 个答案:

没有答案