我無法找到使用裝飾器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和Elasticsearch 你正在用嗎?如果您使用NEST 2.x,請查看https://www.elastic.co/blog/ga-release-of-nest-2-0-our-dot-net-client-for-elasticsearch並特別是打破NEST 1.x和2.x –
@RussCam之間變化的鏈接它是ES 2.2.0和Nest 2.0.2,並且感謝您的鏈接,現在將對其進行審查 – gerosalesc