diff --git a/src/Nest/Document/Single/Delete/DeleteResponse.cs b/src/Nest/Document/Single/Delete/DeleteResponse.cs index 3d286a7a950..ff220463320 100644 --- a/src/Nest/Document/Single/Delete/DeleteResponse.cs +++ b/src/Nest/Document/Single/Delete/DeleteResponse.cs @@ -1,4 +1,5 @@ -using Newtonsoft.Json; +using System; +using Newtonsoft.Json; namespace Nest { @@ -40,14 +41,19 @@ public class DeleteResponse : ResponseBase, IDeleteResponse [JsonProperty("_type")] public string Type { get; internal set; } - + [JsonProperty("_id")] public string Id { get; internal set; } - + [JsonProperty("_version")] public string Version { get; internal set; } - + [JsonProperty("found")] public bool Found { get; internal set; } + + [Obsolete(@"WARNING: IsValid behavior has changed to align with 1.x and 5.x onwards. + It now returns true for 404 responses (document not found), where previously it returned + false. Please use .Found to check whether the document was actually found.")] + public override bool IsValid => base.IsValid; } } diff --git a/src/Nest/Document/Single/Get/GetResponse.cs b/src/Nest/Document/Single/Get/GetResponse.cs index 35caf84b4be..e34c36adc2a 100644 --- a/src/Nest/Document/Single/Get/GetResponse.cs +++ b/src/Nest/Document/Single/Get/GetResponse.cs @@ -1,8 +1,5 @@ using System; -using System.Collections.Generic; -using System.Linq.Expressions; using Newtonsoft.Json; -using System.Linq; namespace Nest { @@ -56,5 +53,10 @@ public class GetResponse : ResponseBase, IGetResponse where T : class public string Routing { get; private set; } public long? Timestamp { get; private set; } public long? Ttl { get; private set; } + + [Obsolete(@"WARNING: IsValid behavior has changed to align with 1.x and 5.x onwards. + It now returns true for 404 responses (document not found), where previously it returned + false. Please use .Found to check whether the document was actually found.")] + public override bool IsValid => base.IsValid; } }