的Ad1的一部分。
此部分已被重构,现在您不能使用ElasticProperty
。它已被替换为一组新属性(如在breaking changes notes描述)
例如
[ElasticProperty(Name="name", Boost = 1.1, OptOut = true)]
public string Name {get; set;}
它相当于
[String(Name="name", Boost = 1.1, Ignore = true)]
public string Name {get; set;}
等
Ad2的。
您可以通过自定义JsonNetSerializer
传递给ConnectionSettings
,就这样修改您的序列化设置:
var connectionPool = new SingleNodeConnectionPool(new Uri("http://localhost:9200"));
var settings = new ConnectionSettings(connectionPool, connectionSettings => new MyJsonNetSerializer(connectionSettings))
.DefaultIndex(indexName)
.DisableDirectStreaming()
.PrettyJson();
public class MyJsonNetSerializer : JsonNetSerializer
{
public MyJsonNetSerializer(IConnectionSettingsValues settings) : base(settings)
{
}
protected override void ModifyJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings)
{
settings.DateParseHandling = DateParseHandling.DateTimeOffset;
}
}
更多细节here和here。
我希望这会令你的迁移变得容易:)
来源
2016-02-19 10:39:16
Rob
QueryDescriptor不NEST 2.X可用,@Rob,你能回答这个http://stackoverflow.com/questions/38136094/what-is -the-替代到querydescriptor巢-2-X –