14
14
import org .elasticsearch .client .transport .TransportClient ;
15
15
import org .elasticsearch .common .settings .Settings ;
16
16
import org .elasticsearch .common .transport .InetSocketTransportAddress ;
17
+ import org .elasticsearch .common .xcontent .XContentFactory ;
17
18
import org .elasticsearch .index .query .QueryBuilders ;
18
19
import org .elasticsearch .index .reindex .DeleteByQueryAction ;
19
20
import org .elasticsearch .index .reindex .DeleteByQueryRequestBuilder ;
@@ -130,7 +131,7 @@ private static void prepareGameOfThronesIndex() {
130
131
"}\n " +
131
132
"}" +
132
133
"} } }" ;
133
- client .admin ().indices ().preparePutMapping (TEST_INDEX ).setType ("gotCharacters" ).setSource (dataMapping ).execute ().actionGet ();
134
+ client .admin ().indices ().preparePutMapping (TEST_INDEX ).setType ("gotCharacters" ).setSource (dataMapping , XContentFactory . xContentType ( dataMapping ) ).execute ().actionGet ();
134
135
}
135
136
136
137
private static void prepareDogsIndex () {
@@ -143,7 +144,7 @@ private static void prepareDogsIndex() {
143
144
" }" +
144
145
" }" +
145
146
"}" ;
146
- client .admin ().indices ().preparePutMapping (TEST_INDEX ).setType ("dog" ).setSource (dataMapping ).execute ().actionGet ();
147
+ client .admin ().indices ().preparePutMapping (TEST_INDEX ).setType ("dog" ).setSource (dataMapping , XContentFactory . xContentType ( dataMapping ) ).execute ().actionGet ();
147
148
}
148
149
149
150
private static void prepareAccountsIndex () {
@@ -164,7 +165,7 @@ private static void prepareAccountsIndex() {
164
165
" }" +
165
166
" }" +
166
167
"}" ;
167
- client .admin ().indices ().preparePutMapping (TEST_INDEX ).setType ("account" ).setSource (dataMapping ).execute ().actionGet ();
168
+ client .admin ().indices ().preparePutMapping (TEST_INDEX ).setType ("account" ).setSource (dataMapping , XContentFactory . xContentType ( dataMapping ) ).execute ().actionGet ();
168
169
}
169
170
170
171
@@ -181,7 +182,7 @@ private static void preparePhrasesIndex() {
181
182
" }" +
182
183
" }" +
183
184
"}" ;
184
- client .admin ().indices ().preparePutMapping (TEST_INDEX ).setType ("phrase" ).setSource (dataMapping ).execute ().actionGet ();
185
+ client .admin ().indices ().preparePutMapping (TEST_INDEX ).setType ("phrase" ).setSource (dataMapping , XContentFactory . xContentType ( dataMapping ) ).execute ().actionGet ();
185
186
}
186
187
187
188
private static void prepareNestedTypeIndex () {
@@ -227,7 +228,7 @@ private static void prepareNestedTypeIndex() {
227
228
" }\n " +
228
229
" }}" ;
229
230
230
- client .admin ().indices ().preparePutMapping (TEST_INDEX ).setType ("nestedType" ).setSource (dataMapping ).execute ().actionGet ();
231
+ client .admin ().indices ().preparePutMapping (TEST_INDEX ).setType ("nestedType" ).setSource (dataMapping , XContentFactory . xContentType ( dataMapping ) ).execute ().actionGet ();
231
232
}
232
233
233
234
private static void prepareChildrenTypeIndex () {
@@ -256,7 +257,7 @@ private static void prepareChildrenTypeIndex() {
256
257
" }" +
257
258
"}\n " ;
258
259
259
- client .admin ().indices ().preparePutMapping (TEST_INDEX ).setType ("childrenType" ).setSource (dataMapping ).execute ().actionGet ();
260
+ client .admin ().indices ().preparePutMapping (TEST_INDEX ).setType ("childrenType" ).setSource (dataMapping , XContentFactory . xContentType ( dataMapping ) ).execute ().actionGet ();
260
261
}
261
262
262
263
private static void prepareParentTypeIndex () {
@@ -272,7 +273,7 @@ private static void prepareParentTypeIndex() {
272
273
" }\n " +
273
274
"}\n " ;
274
275
275
- client .admin ().indices ().preparePutMapping (TEST_INDEX ).setType ("parentType" ).setSource (dataMapping ).execute ().actionGet ();
276
+ client .admin ().indices ().preparePutMapping (TEST_INDEX ).setType ("parentType" ).setSource (dataMapping , XContentFactory . xContentType ( dataMapping ) ).execute ().actionGet ();
276
277
}
277
278
278
279
@ AfterClass
@@ -346,7 +347,7 @@ public static void prepareSpatialIndex(String type){
346
347
"\t }\n " +
347
348
"}" ;
348
349
349
- client .admin ().indices ().preparePutMapping (TEST_INDEX ).setType (type ).setSource (dataMapping ).execute ().actionGet ();
350
+ client .admin ().indices ().preparePutMapping (TEST_INDEX ).setType (type ).setSource (dataMapping , XContentFactory . xContentType ( dataMapping ) ).execute ().actionGet ();
350
351
}
351
352
public static void prepareOdbcIndex (){
352
353
String dataMapping = "{\n " +
@@ -363,7 +364,7 @@ public static void prepareOdbcIndex(){
363
364
"\t }\n " +
364
365
"}" ;
365
366
366
- client .admin ().indices ().preparePutMapping (TEST_INDEX ).setType ("odbc" ).setSource (dataMapping ).execute ().actionGet ();
367
+ client .admin ().indices ().preparePutMapping (TEST_INDEX ).setType ("odbc" ).setSource (dataMapping , XContentFactory . xContentType ( dataMapping ) ).execute ().actionGet ();
367
368
}
368
369
369
370
public static SearchDao getSearchDao () {
0 commit comments