@@ -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