我希望在使用Nest Client的弹性搜索中将ID列作为索引。
public class Person
{
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
答案 0 :(得分:0)
尝试以下方法:
[ElasticType(IdProperty = "Id", Name = "person")]
public class Person
{
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}