I have the following property
[Nested]
public List<TagModel> Tags { get; set; }
and in the TagModel there is a property as follows
[String]
public string Tag { get; set; }
I would like to map the Tag property as a multi field property using Nest.
I thought this would work,
.String
(s => s.Name
(n => n.Tags.First()
.Tag)
.Fields
(fi => fi.String
(sub => sub.Name("partial")
.Analyzer("test"))
.String
(sub => sub.Name("middle")
.Analyzer("test2"))));
But in the mapping it outputs, Tags remains as:
"tags": {
"type": "nested",
"properties": {
"tag": {
"type": "string"
},
and then at the end of the mapping:
"tags.tag": {
"type": "string",
"fields": {
"partial": {
"type": "string",
"analyzer": "test",
},
"middle": {
"type": "string",
"analyzer": "test2",
},
and throws a exception 400 saying reason": "Field name [tags.tag] cannot contain '.'"
I am guessing that it does not like the linq First() call in the name (which is odd as a search in a nested item does accept this....)
So how can I map a property in a class that is used in a property that is a nested item itself....
Currently using Nest 2.0.0 alpha-2