Skip to content

Commit f9fbf9d

Browse files
committed
Merge pull request elastic#882 from Tasteful/issue-873
Test that are failing
2 parents e9a25f5 + fdb563f commit f9fbf9d

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

src/Tests/Nest.Tests.Integration/Mapping/MapTests.cs

+38
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,44 @@ public void GetMissingMap()
115115
var typeMapping = this.Client.GetMapping<ElasticsearchProject>(gm => gm.Index("asdasdasdsada").Type("elasticsearchprojects2")).Mapping;
116116
});
117117
}
118+
119+
[Test]
120+
public void GetAndUpdateMultiFieldMap()
121+
{
122+
var indexName = ElasticsearchConfiguration.NewUniqueIndexName();
123+
124+
var indexCreateResponse = this.Client.CreateIndex(indexName);
125+
Assert.IsTrue(indexCreateResponse.Acknowledged, indexCreateResponse.ConnectionStatus.ToString());
126+
127+
var mapResponse = this.Client.Map<ElasticsearchProject>(m => m
128+
.Index(indexName)
129+
.Properties(props => props
130+
.MultiField(s => s
131+
.Name(p => p.Name)
132+
.Fields(pprops => pprops
133+
.String(ps => ps.Name(p => p.Name).Index(FieldIndexOption.NotAnalyzed))
134+
.String(ps => ps.Name(p => p.Name.Suffix("searchable")).Index(FieldIndexOption.Analyzed))
135+
)
136+
)
137+
)
138+
);
139+
mapResponse.Should().NotBeNull();
140+
Assert.IsTrue(mapResponse.IsValid, mapResponse.ConnectionStatus.ToString());
118141

142+
var getMapResponse = this.Client.GetMapping<ElasticsearchProject>(m => m.Index(indexName));
143+
getMapResponse.Should().NotBeNull();
144+
Assert.IsTrue(getMapResponse.IsValid, getMapResponse.ConnectionStatus.ToString());
145+
getMapResponse.Mapping.Should().NotBeNull();
146+
147+
mapResponse = this.Client.Map<ElasticsearchProject>(p => p
148+
.Index(indexName)
149+
.InitializeUsing(getMapResponse.Mapping)
150+
);
151+
mapResponse.Should().NotBeNull();
152+
Assert.IsTrue(mapResponse.IsValid, mapResponse.ConnectionStatus.ToString());
153+
154+
var indexDeleteResponse = this.Client.DeleteIndex(x => x.Index(indexName));
155+
Assert.IsTrue(indexDeleteResponse.Acknowledged, indexDeleteResponse.ConnectionStatus.ToString());
156+
}
119157
}
120158
}

0 commit comments

Comments
 (0)