编译器找不到 Nest 中的映射器装饰器



我找不到使用文档中提到的装饰器ElasticProperty和ElasticType的方法。它们在库中无处可寻,并且在编译时崩溃。

演示代码:

[ElasticType(
    Name = "elasticsearchprojects2",
    DateDetection = true,
    NumericDetection = true,
    SearchAnalyzer = "standard",
    IndexAnalyzer = "standard",
    DynamicDateFormats = new[] { "dateOptionalTime", "yyyy/MM/dd HH:mm:ss Z||yyyy/MM/dd Z" }
)]
public class ElasticSearchProject
{
    public int Id { get; set;  }
    public string Name { get; set; }
    [ElasticProperty(OmitNorms = true, Index = FieldIndexOption.not_analyzed)]
    public string Country { get; set; }

根据我刚刚回顾的内容,NEST API 似乎分别通过 ElasticSearchType 和 ElasticsearchPropertyAttributeBase 更改了这些属性/装饰器。请验证

Nest 的当前文档已经过时,但团队目前正在努力更新它。现在我们有这篇关于 Nest 2.0 重大更改的文章,它解释了 API 中的更改:

重命名的类型

  • 类聚合描述符'1
  • class AggregationContainerDescriptor'1

  • 类别名请求

  • 类批量别名请求

  • 类全字段映射

  • 类 全场

  • 类分配ClusteRerouteCommand

  • 类分配群集重新路由命令

  • 类分析设置

  • 类分析

  • 类和过滤器

  • 类和查询

  • 类平均聚合器

  • 类平均聚合

。粘贴所有更改时达到正文限制

最新更新