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

Mapper decorators in Nest not found by compiler

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

演示代码:

[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 似乎已通过 ElasticSearchTypeElasticsearchPropertyAttributeBase[ 更改了这些 attributes/decorators =14=]分别。 请验证

Nest 的当前文档已过时,但团队目前正在努力更新它。现在我们有 this article about Nest 2.0 breaking changes 来解释 API:

中的变化

Renamed Types

  • class AggregationDescriptor`1
  • class AggregationContainerDescriptor`1

  • class AliasRequest

  • class BulkAliasRequest

  • class AllFieldMapping

  • class AllField

  • class AllocateClusteRerouteCommand

  • class AllocateClusterRerouteCommand

  • class AnalysisSettings

  • class Analysis

  • class AndFilter

  • class AndQuery

  • class AverageAggregator

  • class AverageAggregation

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