我在 elastic search 1.0 中使用了以下的 Elastic 属性。
[ElasticProperty(Name = "description", Index = FieldIndexOption.Analyzed, Type = FieldType.String, Analyzer = "custom_lowercase_analyzer", SearchAnalyzer = "search_analyser")]
public string description { get; set; }
我们如何在elasticsearch 2.0中使用这些属性?
你可以参考 此处 更多细节。
[Text(Name = "first_name", Analyzer = "custom_lowercase_analyzer", SearchAnalyzer = "search_analyser")]
public string description { get; set; }
Index = FieldIndexOption.Analyzed被删除,取而代之的是Index=true或false Index默认为true,所以你不需要提供它。