Skip to content

Commit e0e3887

Browse files
committed
_percolate should only be part of the Index bulk action fix #394
1 parent dfa1c45 commit e0e3887

File tree

7 files changed

+10
-21
lines changed

7 files changed

+10
-21
lines changed

src/Nest.Tests.Unit/Core/Bulk/BulkTests.cs

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ public void BulkUpdateDetails()
3333
.Document(new { name = "NEST" })
3434
.RetriesOnConflict(4)
3535
)
36+
.Index<ElasticSearchProject>(i=>i
37+
.Object(new ElasticSearchProject { Name = "yodawg", Id = 90})
38+
.Percolate("percolateme")
39+
)
3640
);
3741
var status = result.ConnectionStatus;
3842
this.BulkJsonEquals(status.Request, MethodInfo.GetCurrentMethod());
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
{ "update" : {"_index":"nest_test_data","_type":"elasticsearchprojects","_id":"3", "_retry_on_conflict" : 4} }
2-
{"doc":{"name":"NEST"}}
2+
{"doc":{"name":"NEST"}}
3+
{ "index" : {"_percolate":"percolateme","_index":"nest_test_data","_type":"elasticsearchprojects","_id":"90"} }
4+
{"id":90,"name":"yodawg","loc":0,"startedOn":"0001-01-01T00:00:00","longValue":0,"floatValue":0.0,"doubleValue":0.0,"boolValue":false,"locScriptField":0,"stupidIntIWantAsLong":0}

src/Nest/DSL/BulkCreateDescriptor.cs

-6
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,6 @@ public BulkCreateDescriptor<T> Routing(string routing)
104104
return this;
105105
}
106106

107-
public BulkCreateDescriptor<T> Percolate(string percolate)
108-
{
109-
this._Percolate = percolate;
110-
return this;
111-
}
112-
113107
public BulkCreateDescriptor<T> Parent(string parent)
114108
{
115109
this._Parent = parent;

src/Nest/DSL/BulkDeleteDescriptor.cs

-6
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,6 @@ public BulkDeleteDescriptor<T> Routing(string routing)
104104
return this;
105105
}
106106

107-
public BulkDeleteDescriptor<T> Percolate(string percolate)
108-
{
109-
this._Percolate = percolate;
110-
return this;
111-
}
112-
113107
public BulkDeleteDescriptor<T> Parent(string parent)
114108
{
115109
this._Parent = parent;

src/Nest/DSL/BulkIndexDescriptor.cs

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Globalization;
33
using Nest.Resolvers;
4+
using Newtonsoft.Json;
45

56
namespace Nest
67
{
@@ -12,6 +13,8 @@ public class BulkIndexDescriptor<T> : BaseBulkOperation
1213
internal override string _Operation { get { return "index"; } }
1314
internal override object _Object { get; set; }
1415

16+
[JsonProperty(PropertyName = "_percolate")]
17+
internal string _Percolate { get; set; }
1518

1619
private readonly TypeNameResolver _typeNameResolver;
1720

src/Nest/DSL/BulkUpdateDescriptor.cs

-6
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,6 @@ public BulkUpdateDescriptor<T, K> Routing(string routing)
177177
return this;
178178
}
179179

180-
public BulkUpdateDescriptor<T, K> Percolate(string percolate)
181-
{
182-
this._Percolate = percolate;
183-
return this;
184-
}
185-
186180
public BulkUpdateDescriptor<T, K> Parent(string parent)
187181
{
188182
this._Parent = parent;

src/Nest/Domain/Bulk/BaseBulkOperation.cs

-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ public abstract class BaseBulkOperation
2929
[JsonProperty(PropertyName = "_routing")]
3030
internal string _Routing { get; set; }
3131

32-
[JsonProperty(PropertyName = "_percolate")]
33-
internal string _Percolate { get; set; }
3432

3533
[JsonProperty(PropertyName = "_parent")]
3634
internal string _Parent { get; set; }

0 commit comments

Comments
 (0)