Skip to content

Commit d233066

Browse files
committed
Include the analyzer in the token_count datatype serialized json
Fixes #1744
1 parent c49a3ae commit d233066

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/Nest/Mapping/Types/Specialized/TokenCount/TokenCountProperty.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ namespace Nest
55
[JsonObject(MemberSerialization.OptIn)]
66
public interface ITokenCountProperty : INumberProperty
77
{
8+
[JsonProperty("analyzer")]
89
string Analyzer { get; set; }
910
}
1011

src/Tests/ClientConcepts/HighLevel/Mapping/AutoMap.doc.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,10 @@ public void OverridingAutoMappedAttributes()
468468
.Name("firstNameRaw")
469469
.Index(FieldIndexOption.NotAnalyzed)
470470
)
471+
.TokenCount(t => t
472+
.Name("length")
473+
.Analyzer("standard")
474+
)
471475
)
472476
)
473477
.Number(n => n
@@ -554,8 +558,13 @@ public void OverridingAutoMappedAttributes()
554558
{
555559
index = "not_analyzed",
556560
type = "string"
557-
}
558-
},
561+
},
562+
length = new
563+
{
564+
type = "token_count",
565+
analyzer = "standard"
566+
},
567+
},
559568
type = "string"
560569
},
561570
isManager = new

0 commit comments

Comments
 (0)