Skip to content

Commit 8dd084d

Browse files
russcamMpdreamz
authored andcommitted
Add include_in_all to TypeMapping (#2431)
Closes #2421
1 parent e79de6a commit 8dd084d

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

src/Nest/Indices/MappingManagement/PutMapping/PutMappingRequest.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ internal PutMappingRequest() { }
2121
/// <inheritdoc/>
2222
public bool? DateDetection { get; set; }
2323
/// <inheritdoc/>
24+
public bool? IncludeInAll { get; set; }
25+
/// <inheritdoc/>
2426
public IEnumerable<string> DynamicDateFormats { get; set; }
2527
/// <inheritdoc/>
2628
public IDynamicTemplateContainer DynamicTemplates { get; set; }
@@ -59,6 +61,8 @@ public PutMappingRequest() : this(typeof(T), typeof(T)) { }
5961
/// <inheritdoc/>
6062
public bool? DateDetection { get; set; }
6163
/// <inheritdoc/>
64+
public bool? IncludeInAll { get; set; }
65+
/// <inheritdoc/>
6266
public IEnumerable<string> DynamicDateFormats { get; set; }
6367
/// <inheritdoc/>
6468
public IDynamicTemplateContainer DynamicTemplates { get; set; }
@@ -98,6 +102,7 @@ public PutMappingDescriptor(IndexName index, TypeName type) : base(r=>r.Required
98102

99103
IAllField ITypeMapping.AllField { get; set; }
100104
bool? ITypeMapping.DateDetection { get; set; }
105+
bool? ITypeMapping.IncludeInAll { get; set; }
101106
IEnumerable<string> ITypeMapping.DynamicDateFormats { get; set; }
102107
string ITypeMapping.Analyzer { get; set; }
103108
string ITypeMapping.SearchAnalyzer { get; set; }
@@ -131,6 +136,9 @@ public PutMappingDescriptor<T> AutoMap(IPropertyVisitor visitor = null, int maxR
131136
/// <inheritdoc/>
132137
public PutMappingDescriptor<T> Dynamic(bool dynamic = true) => Assign(a => a.Dynamic = dynamic);
133138

139+
/// <inheritdoc/>
140+
public PutMappingDescriptor<T> IncludeInAll(bool include = true) => Assign(a => a.IncludeInAll = include);
141+
134142
/// <inheritdoc/>
135143
public PutMappingDescriptor<T> Parent(TypeName parentType) => Assign(a => a.ParentField = new ParentField { Type = parentType });
136144

src/Nest/Mapping/TypeMapping.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ public interface ITypeMapping
1717
[JsonProperty("numeric_detection")]
1818
bool? NumericDetection { get; set; }
1919

20+
[JsonProperty("include_in_all")]
21+
bool? IncludeInAll { get; set; }
22+
2023
[JsonProperty("analyzer")]
2124
string Analyzer { get; set; }
2225

@@ -67,6 +70,8 @@ public class TypeMapping : ITypeMapping
6770
/// <inheritdoc/>
6871
public bool? DateDetection { get; set; }
6972
/// <inheritdoc/>
73+
public bool? IncludeInAll { get; set; }
74+
/// <inheritdoc/>
7075
public Union<bool, DynamicMapping> Dynamic { get; set; }
7176
/// <inheritdoc/>
7277
public IEnumerable<string> DynamicDateFormats { get; set; }
@@ -102,6 +107,7 @@ public class TypeMappingDescriptor<T> : DescriptorBase<TypeMappingDescriptor<T>,
102107
IAllField ITypeMapping.AllField { get; set; }
103108
string ITypeMapping.Analyzer { get; set; }
104109
bool? ITypeMapping.DateDetection { get; set; }
110+
bool? ITypeMapping.IncludeInAll { get; set; }
105111
Union<bool, DynamicMapping> ITypeMapping.Dynamic { get; set; }
106112
IEnumerable<string> ITypeMapping.DynamicDateFormats { get; set; }
107113
IDynamicTemplateContainer ITypeMapping.DynamicTemplates { get; set; }
@@ -131,10 +137,11 @@ public TypeMappingDescriptor<T> AutoMap(IPropertyVisitor visitor = null, int max
131137
/// <inheritdoc/>
132138
public TypeMappingDescriptor<T> Dynamic(Union<bool, DynamicMapping> dynamic) => Assign(a => a.Dynamic = dynamic);
133139

134-
135140
/// <inheritdoc/>
136141
public TypeMappingDescriptor<T> Dynamic(bool dynamic = true) => Assign(a => a.Dynamic = dynamic);
137142

143+
/// <inheritdoc/>
144+
public TypeMappingDescriptor<T> IncludeInAll(bool include = true) => Assign(a => a.IncludeInAll = include);
138145

139146
/// <inheritdoc/>
140147
public TypeMappingDescriptor<T> Parent(TypeName parentType) => Assign(a => a.ParentField = new ParentField { Type = parentType });

src/Tests/Indices/MappingManagement/PutMapping/PutMappingApiTest.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ protected override LazyResponses ClientUsage() => Calls(
2929

3030
protected override object ExpectJson { get; } = new
3131
{
32+
include_in_all = true,
3233
properties = new
3334
{
3435
branches = new
@@ -178,6 +179,7 @@ protected override LazyResponses ClientUsage() => Calls(
178179

179180
protected override Func<PutMappingDescriptor<Project>, IPutMappingRequest> Fluent => d => d
180181
.Index(CallIsolatedValue)
182+
.IncludeInAll()
181183
.AutoMap()
182184
.Properties(prop => prop
183185
.Object<Tag>(o => o
@@ -223,6 +225,7 @@ protected override LazyResponses ClientUsage() => Calls(
223225

224226
protected override PutMappingRequest<Project> Initializer => new PutMappingRequest<Project>(CallIsolatedValue, Type<Project>())
225227
{
228+
IncludeInAll = true,
226229
Properties = new Properties<Project>
227230
{
228231
{ p => p.Branches, new TextProperty

0 commit comments

Comments
 (0)