Skip to content

Commit b036d81

Browse files
russcamMpdreamz
authored andcommitted
Include Result property on IBulkResponseItem (#3376)
closes #3375 (cherry picked from commit 5bf170d)
1 parent 07b8bbb commit b036d81

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

src/Nest/Document/Multiple/Bulk/BulkResponseItem/BulkIndexResponseItem.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ public class BulkIndexResponseItem : BulkResponseItemBase
1010
public override string Operation { get; internal set; }
1111

1212
/// <summary>
13-
/// Null if Percolation was not requested while indexing this doc, otherwise returns the percolator _ids that matched (if any)
13+
/// The _ids that matched (if any) for the Percolate API.
14+
/// Will be null if the operation is not in response to Percolate API.
1415
/// </summary>
1516
[JsonProperty("matches")]
1617
public IEnumerable<string> Matches { get; internal set; }

src/Nest/Document/Multiple/Bulk/BulkResponseItem/BulkResponseItemBase.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ public interface IBulkResponseItem
3838
[JsonProperty("_version")]
3939
long Version { get; }
4040

41+
/// <summary>
42+
/// The result of the bulk operation
43+
/// </summary>
44+
[JsonProperty("result")]
45+
string Result { get; }
46+
4147
/// <summary>
4248
/// The status of the bulk operation
4349
/// </summary>
@@ -86,6 +92,9 @@ public abstract class BulkResponseItemBase : IBulkResponseItem
8692
/// <inheritdoc />
8793
public long Version { get; internal set; }
8894

95+
/// <inheritdoc />
96+
public string Result { get; internal set; }
97+
8998
/// <inheritdoc />
9099
public int Status { get; internal set; }
91100

src/Tests/Tests/Document/Multiple/Bulk/BulkApiTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ protected override void ExpectResponse(IBulkResponse response)
144144
item.Shards.Successful.Should().BeGreaterThan(0);
145145
item.SequenceNumber.Should().BeGreaterOrEqualTo(0);
146146
item.PrimaryTerm.Should().BeGreaterThan(0);
147+
item.Result.Should().NotBeNullOrEmpty();
147148
}
148149

149150
var project1 = this.Client.Source<Project>(Project.Instance.Name, p => p.Index(CallIsolatedValue));

0 commit comments

Comments
 (0)