Skip to content

Commit 68166c3

Browse files
committed
Merge pull request #1726 from elastic/fix/norms-mapping
Fix/norms mapping
2 parents edf60a4 + 7005043 commit 68166c3

File tree

21 files changed

+92
-40
lines changed

21 files changed

+92
-40
lines changed

src/Nest/Mapping/Norms/Norms.cs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using System;
2+
using Newtonsoft.Json;
3+
using Newtonsoft.Json.Converters;
4+
5+
namespace Nest
6+
{
7+
[JsonObject(MemberSerialization.OptIn)]
8+
[JsonConverter(typeof(ReadAsTypeJsonConverter<Norms>))]
9+
public interface INorms
10+
{
11+
[JsonProperty("enabled")]
12+
bool? Enabled { get; set; }
13+
14+
[JsonProperty("loading")]
15+
[JsonConverter(typeof(StringEnumConverter))]
16+
NormsLoading? Loading { get; set; }
17+
}
18+
19+
public class Norms : INorms
20+
{
21+
public bool? Enabled { get; set; }
22+
public NormsLoading? Loading { get; set; }
23+
}
24+
25+
public class NormsDescriptor : DescriptorBase<NormsDescriptor, INorms>, INorms
26+
{
27+
bool? INorms.Enabled { get; set; }
28+
NormsLoading? INorms.Loading { get; set; }
29+
30+
public NormsDescriptor Enabled(bool enabled = true) => Assign(a => a.Enabled = enabled);
31+
public NormsDescriptor Loading(NormsLoading loading) => Assign(a => a.Loading = loading);
32+
}
33+
}

src/Nest/Mapping/Norms/NormsMapping.cs

Lines changed: 0 additions & 17 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/Nest/Mapping/AttributeBased/StringAttribute.cs renamed to src/Nest/Mapping/Types/Core/String/StringAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class StringAttribute : ElasticsearchPropertyAttribute, IStringProperty
88
TermVectorOption? IStringProperty.TermVector { get; set; }
99
double? IStringProperty.Boost { get; set; }
1010
string IStringProperty.NullValue { get; set; }
11-
NormsMapping IStringProperty.Norms { get; set; }
11+
INorms IStringProperty.Norms { get; set; }
1212
IndexOptions? IStringProperty.IndexOptions { get; set; }
1313
string IStringProperty.Analyzer { get; set; }
1414
string IStringProperty.SearchAnalyzer { get; set; }

0 commit comments

Comments
 (0)