@@ -62,7 +62,7 @@ public void testDeleteIndex() throws IOException {
62
62
RestHighLevelClient client = highLevelClient ();
63
63
64
64
{
65
- CreateIndexResponse createIndexResponse = client .indices ().createIndex (new CreateIndexRequest ("posts" ));
65
+ CreateIndexResponse createIndexResponse = client .indices ().create (new CreateIndexRequest ("posts" ));
66
66
assertTrue (createIndexResponse .isAcknowledged ());
67
67
}
68
68
@@ -84,7 +84,7 @@ public void testDeleteIndex() throws IOException {
84
84
// end::delete-index-request-indicesOptions
85
85
86
86
// tag::delete-index-execute
87
- DeleteIndexResponse deleteIndexResponse = client .indices ().deleteIndex (request );
87
+ DeleteIndexResponse deleteIndexResponse = client .indices ().delete (request );
88
88
// end::delete-index-execute
89
89
90
90
// tag::delete-index-response
@@ -97,7 +97,7 @@ public void testDeleteIndex() throws IOException {
97
97
// tag::delete-index-notfound
98
98
try {
99
99
DeleteIndexRequest request = new DeleteIndexRequest ("does_not_exist" );
100
- client .indices ().deleteIndex (request );
100
+ client .indices ().delete (request );
101
101
} catch (ElasticsearchException exception ) {
102
102
if (exception .status () == RestStatus .NOT_FOUND ) {
103
103
// <1>
@@ -111,15 +111,15 @@ public void testDeleteIndexAsync() throws Exception {
111
111
final RestHighLevelClient client = highLevelClient ();
112
112
113
113
{
114
- CreateIndexResponse createIndexResponse = client .indices ().createIndex (new CreateIndexRequest ("posts" ));
114
+ CreateIndexResponse createIndexResponse = client .indices ().create (new CreateIndexRequest ("posts" ));
115
115
assertTrue (createIndexResponse .isAcknowledged ());
116
116
}
117
117
118
118
{
119
119
DeleteIndexRequest request = new DeleteIndexRequest ("posts" );
120
120
121
121
// tag::delete-index-execute-async
122
- client .indices ().deleteIndexAsync (request , new ActionListener <DeleteIndexResponse >() {
122
+ client .indices ().deleteAsync (request , new ActionListener <DeleteIndexResponse >() {
123
123
@ Override
124
124
public void onResponse (DeleteIndexResponse deleteIndexResponse ) {
125
125
// <1>
@@ -189,7 +189,7 @@ public void testCreateIndex() throws IOException {
189
189
// end::create-index-request-waitForActiveShards
190
190
191
191
// tag::create-index-execute
192
- CreateIndexResponse createIndexResponse = client .indices ().createIndex (request );
192
+ CreateIndexResponse createIndexResponse = client .indices ().create (request );
193
193
// end::create-index-execute
194
194
195
195
// tag::create-index-response
@@ -207,7 +207,7 @@ public void testCreateIndexAsync() throws Exception {
207
207
{
208
208
CreateIndexRequest request = new CreateIndexRequest ("twitter" );
209
209
// tag::create-index-execute-async
210
- client .indices ().createIndexAsync (request , new ActionListener <CreateIndexResponse >() {
210
+ client .indices ().createAsync (request , new ActionListener <CreateIndexResponse >() {
211
211
@ Override
212
212
public void onResponse (CreateIndexResponse createIndexResponse ) {
213
213
// <1>
@@ -232,7 +232,7 @@ public void testOpenIndex() throws IOException {
232
232
RestHighLevelClient client = highLevelClient ();
233
233
234
234
{
235
- CreateIndexResponse createIndexResponse = client .indices ().createIndex (new CreateIndexRequest ("index" ));
235
+ CreateIndexResponse createIndexResponse = client .indices ().create (new CreateIndexRequest ("index" ));
236
236
assertTrue (createIndexResponse .isAcknowledged ());
237
237
}
238
238
@@ -260,7 +260,7 @@ public void testOpenIndex() throws IOException {
260
260
// end::open-index-request-indicesOptions
261
261
262
262
// tag::open-index-execute
263
- OpenIndexResponse openIndexResponse = client .indices ().openIndex (request );
263
+ OpenIndexResponse openIndexResponse = client .indices ().open (request );
264
264
// end::open-index-execute
265
265
266
266
// tag::open-index-response
@@ -271,7 +271,7 @@ public void testOpenIndex() throws IOException {
271
271
assertTrue (shardsAcked );
272
272
273
273
// tag::open-index-execute-async
274
- client .indices ().openIndexAsync (request , new ActionListener <OpenIndexResponse >() {
274
+ client .indices ().openAsync (request , new ActionListener <OpenIndexResponse >() {
275
275
@ Override
276
276
public void onResponse (OpenIndexResponse openIndexResponse ) {
277
277
// <1>
@@ -289,7 +289,7 @@ public void onFailure(Exception e) {
289
289
// tag::open-index-notfound
290
290
try {
291
291
OpenIndexRequest request = new OpenIndexRequest ("does_not_exist" );
292
- client .indices ().openIndex (request );
292
+ client .indices ().open (request );
293
293
} catch (ElasticsearchException exception ) {
294
294
if (exception .status () == RestStatus .BAD_REQUEST ) {
295
295
// <1>
@@ -303,7 +303,7 @@ public void testCloseIndex() throws IOException {
303
303
RestHighLevelClient client = highLevelClient ();
304
304
305
305
{
306
- CreateIndexResponse createIndexResponse = client .indices ().createIndex (new CreateIndexRequest ("index" ));
306
+ CreateIndexResponse createIndexResponse = client .indices ().create (new CreateIndexRequest ("index" ));
307
307
assertTrue (createIndexResponse .isAcknowledged ());
308
308
}
309
309
@@ -326,7 +326,7 @@ public void testCloseIndex() throws IOException {
326
326
// end::close-index-request-indicesOptions
327
327
328
328
// tag::close-index-execute
329
- CloseIndexResponse closeIndexResponse = client .indices ().closeIndex (request );
329
+ CloseIndexResponse closeIndexResponse = client .indices ().close (request );
330
330
// end::close-index-execute
331
331
332
332
// tag::close-index-response
@@ -335,7 +335,7 @@ public void testCloseIndex() throws IOException {
335
335
assertTrue (acknowledged );
336
336
337
337
// tag::close-index-execute-async
338
- client .indices ().closeIndexAsync (request , new ActionListener <CloseIndexResponse >() {
338
+ client .indices ().closeAsync (request , new ActionListener <CloseIndexResponse >() {
339
339
@ Override
340
340
public void onResponse (CloseIndexResponse closeIndexResponse ) {
341
341
// <1>
@@ -353,7 +353,7 @@ public void onFailure(Exception e) {
353
353
// tag::close-index-notfound
354
354
try {
355
355
CloseIndexRequest request = new CloseIndexRequest ("does_not_exist" );
356
- client .indices ().closeIndex (request );
356
+ client .indices ().close (request );
357
357
} catch (ElasticsearchException exception ) {
358
358
if (exception .status () == RestStatus .BAD_REQUEST ) {
359
359
// <1>
0 commit comments