Skip to content

Commit

Permalink
Include Result property on IBulkResponseItem
Browse files Browse the repository at this point in the history
closes #3375
  • Loading branch information
russcam committed Aug 22, 2018
1 parent 2ab4db2 commit f054dc5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ public class BulkIndexResponseItem : BulkResponseItemBase
public override string Operation { get; internal set; }

/// <summary>
/// Null if Percolation was not requested while indexing this doc, otherwise returns the percolator _ids that matched (if any)
/// The _ids that matched (if any) for the Percolate API.
/// Will be null if the operation is not in response to Percolate API.
/// </summary>
[JsonProperty("matches")]
public IEnumerable<string> Matches { get; internal set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ public interface IBulkResponseItem
[JsonProperty("_version")]
long Version { get; }

/// <summary>
/// The result of the bulk operation
/// </summary>
[JsonProperty("result")]
string Result { get; }

/// <summary>
/// The status of the bulk operation
/// </summary>
Expand Down Expand Up @@ -86,6 +92,9 @@ public abstract class BulkResponseItemBase : IBulkResponseItem
/// <inheritdoc />
public long Version { get; internal set; }

/// <inheritdoc />
public string Result { get; internal set; }

/// <inheritdoc />
public int Status { get; internal set; }

Expand Down
1 change: 1 addition & 0 deletions src/Tests/Tests/Document/Multiple/Bulk/BulkApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ protected override void ExpectResponse(IBulkResponse response)
item.Shards.Successful.Should().BeGreaterThan(0);
item.SequenceNumber.Should().BeGreaterOrEqualTo(0);
item.PrimaryTerm.Should().BeGreaterThan(0);
item.Result.Should().NotBeNullOrEmpty();
}

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

0 comments on commit f054dc5

Please sign in to comment.