Skip to content

Commit 76f4721

Browse files
committed
Merge branch 'develop' of github.com:elastic/elasticsearch-net into develop
2 parents 389d9dc + d9461d2 commit 76f4721

File tree

4 files changed

+68
-2
lines changed

4 files changed

+68
-2
lines changed

src/Nest/DSL/Filter/HasChildFilterDescriptor.cs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ public interface IHasChildFilter : IFilter
1313
[JsonProperty("type")]
1414
TypeNameMarker Type { get; set; }
1515

16+
[JsonProperty("min_children")]
17+
int? MinChildren { get; set; }
18+
19+
[JsonProperty("max_children")]
20+
int? MaxChildren { get; set; }
21+
1622
[JsonProperty("query")]
1723
IQueryContainer Query { get; set; }
1824

@@ -25,7 +31,7 @@ public interface IHasChildFilter : IFilter
2531
IInnerHits InnerHits { get; set; }
2632

2733
}
28-
34+
2935
public class HasChildFilter : PlainFilter, IHasChildFilter
3036
{
3137
protected internal override void WrapInContainer(IFilterContainer container)
@@ -34,6 +40,8 @@ protected internal override void WrapInContainer(IFilterContainer container)
3440
}
3541

3642
public TypeNameMarker Type { get; set; }
43+
public int? MinChildren { get; set; }
44+
public int? MaxChildren { get; set; }
3745
public IQueryContainer Query { get; set; }
3846
public IFilterContainer Filter { get; set; }
3947
public IInnerHits InnerHits { get; set; }
@@ -57,6 +65,10 @@ bool IFilter.IsConditionless
5765

5866
TypeNameMarker IHasChildFilter.Type { get; set; }
5967

68+
int? IHasChildFilter.MinChildren { get; set; }
69+
70+
int? IHasChildFilter.MaxChildren { get; set; }
71+
6072
IQueryContainer IHasChildFilter.Query { get; set; }
6173

6274
IFilterContainer IHasChildFilter.Filter { get; set; }
@@ -88,6 +100,18 @@ public HasChildFilterDescriptor<T> Type(string type)
88100
return this;
89101
}
90102

103+
public HasChildFilterDescriptor<T> MinChildren(int minChildren)
104+
{
105+
Self.MinChildren = minChildren;
106+
return this;
107+
}
108+
109+
public HasChildFilterDescriptor<T> MaxChildren(int maxChildren)
110+
{
111+
Self.MaxChildren = maxChildren;
112+
return this;
113+
}
114+
91115
public HasChildFilterDescriptor<T> InnerHits()
92116
{
93117
Self.InnerHits = new InnerHits();

src/Nest/Domain/Analysis/TokenFilter/WordDelimiterTokenFilter.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Collections.Generic;
22
using Newtonsoft.Json;
3+
using System;
34

45
namespace Nest
56
{
@@ -47,9 +48,12 @@ public WordDelimiterTokenFilter()
4748
[JsonProperty("protected_words_path ")]
4849
public string ProtectedWordsPath { get; set; }
4950

50-
[JsonProperty("type_table")]
51+
[Obsolete("Please switch to TypeTableList property", true)]
5152
public string TypeTable { get; set; }
5253

54+
[JsonProperty("type_table")]
55+
public List<string> TypeTableList { get; set; }
56+
5357
[JsonProperty("type_table_path")]
5458
public string TypeTablePath { get; set; }
5559
}

src/Tests/Nest.Tests.Integration/Nest.Tests.Integration.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@
181181
<Compile Include="Reproduce\Reproduce1403Tests.cs" />
182182
<Compile Include="Reproduce\Reproduce1457Tests.cs" />
183183
<Compile Include="Reproduce\Reproduce1474Tests.cs" />
184+
<Compile Include="Reproduce\Reproduce1515Tests.cs" />
184185
<Compile Include="Reproduce\Reproduce769Tests.cs" />
185186
<Compile Include="Reproduce\Reproduce945Tests.cs" />
186187
<Compile Include="Reproduce\Reproduce953Tests.cs" />
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using Elasticsearch.Net;
2+
using Nest.Tests.MockData.Domain;
3+
using NUnit.Framework;
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Linq;
7+
using System.Text;
8+
using System.Threading.Tasks;
9+
using FluentAssertions;
10+
11+
namespace Nest.Tests.Integration.Reproduce
12+
{
13+
[TestFixture]
14+
public class Reproduce1515Tests : IntegrationTests
15+
{
16+
[Test]
17+
public void Test()
18+
{
19+
var result = Client.Search<ElasticsearchProject>(s => s
20+
.SearchType(SearchType.Count)
21+
.Aggregations(ag => ag
22+
.Terms("countries", st => st
23+
.Field("country")
24+
.Size(10)
25+
.Aggregations(aa => aa
26+
.Terms("names", t => t
27+
.Field(f => f.Name)
28+
)
29+
)
30+
)
31+
)
32+
);
33+
34+
result.IsValid.Should().BeTrue();
35+
}
36+
}
37+
}

0 commit comments

Comments
 (0)