我无法找到使用装饰器的方法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; }
答案 0 :(得分:2)
根据我刚刚审核的内容,似乎NEST API分别通过 ElasticSearchType 和 ElasticsearchPropertyAttributeBase 更改了这些属性/装饰器。 请验证
答案 1 :(得分:1)
Nest的当前文档已过时,但团队目前正在努力更新它。目前我们已this article about Nest 2.0 breaking changes解释了API中的更改:
重命名类型
- class AggregationDescriptor`1
class AggregationContainerDescriptor`1
类AliasRequest
class BulkAliasRequest
类AllFieldMapping
类AllField
类AllocateClusteRerouteCommand
类AllocateClusterRerouteCommand
class AnalysisSettings
课程分析
class AndFilter
class AndQuery
class AverageAggregator
- class AverageAggregation
...粘贴所有更改时达到的正文限制