2828import org .elasticsearch .action .admin .indices .cache .clear .ClearIndicesCacheRequest ;
2929import org .elasticsearch .action .admin .indices .cache .clear .ClearIndicesCacheResponse ;
3030import org .elasticsearch .action .admin .indices .close .CloseIndexRequest ;
31- import org .elasticsearch .action .admin .indices .create .CreateIndexRequest ;
32- import org .elasticsearch .action .admin .indices .create .CreateIndexResponse ;
3331import org .elasticsearch .action .admin .indices .delete .DeleteIndexRequest ;
3432import org .elasticsearch .action .admin .indices .flush .FlushRequest ;
3533import org .elasticsearch .action .admin .indices .flush .FlushResponse ;
6058import org .elasticsearch .action .admin .indices .validate .query .ValidateQueryResponse ;
6159import org .elasticsearch .action .support .master .AcknowledgedResponse ;
6260import org .elasticsearch .client .core .ShardsAcknowledgedResponse ;
61+ import org .elasticsearch .client .indices .CreateIndexRequest ;
62+ import org .elasticsearch .client .indices .CreateIndexResponse ;
6363import org .elasticsearch .client .indices .FreezeIndexRequest ;
6464import org .elasticsearch .client .indices .GetIndexTemplatesRequest ;
6565import org .elasticsearch .client .indices .IndexTemplatesExistRequest ;
@@ -147,24 +147,52 @@ public void deleteAsync(DeleteIndexRequest deleteIndexRequest, ActionListener<Ac
147147 * @return the response
148148 * @throws IOException in case there is a problem sending the request or parsing back the response
149149 */
150- public CreateIndexResponse create (CreateIndexRequest createIndexRequest , RequestOptions options ) throws IOException {
150+ public CreateIndexResponse create (CreateIndexRequest createIndexRequest ,
151+ RequestOptions options ) throws IOException {
151152 return restHighLevelClient .performRequestAndParseEntity (createIndexRequest , IndicesRequestConverters ::createIndex , options ,
152- CreateIndexResponse ::fromXContent , emptySet ());
153+ CreateIndexResponse ::fromXContent , emptySet ());
153154 }
154155
155156 /**
156157 * Creates an index using the Create Index API.
157158 * <p>
158159 * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html">
159160 * Create Index API on elastic.co</a>
160- * @deprecated Prefer {@link #create(CreateIndexRequest, RequestOptions)}
161+ *
162+ * @deprecated This method uses an old request object which still refers to types, a deprecated feature. The
163+ * method {@link #create(CreateIndexRequest, RequestOptions)} should be used instead, which accepts a new
164+ * request object and also uses request options instead of headers.
161165 */
162166 @ Deprecated
163- public CreateIndexResponse create (CreateIndexRequest createIndexRequest , Header ... headers ) throws IOException {
167+ public CreateIndexResponse create (
168+ org .elasticsearch .action .admin .indices .create .CreateIndexRequest createIndexRequest ,
169+ Header ... headers ) throws IOException {
164170 return restHighLevelClient .performRequestAndParseEntity (createIndexRequest , IndicesRequestConverters ::createIndex ,
165171 CreateIndexResponse ::fromXContent , emptySet (), headers );
166172 }
167173
174+ /**
175+ * Creates an index using the Create Index API.
176+ * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html">
177+ * Create Index API on elastic.co</a>
178+ * @param createIndexRequest the request
179+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
180+ * @return the response
181+ * @throws IOException in case there is a problem sending the request or parsing back the response
182+ *
183+ * @deprecated This method uses an old request object which still refers to types, a deprecated feature. The
184+ * method {@link #create(CreateIndexRequest, RequestOptions)} should be used instead, which accepts a new
185+ * request object.
186+ */
187+ @ Deprecated
188+ public org .elasticsearch .action .admin .indices .create .CreateIndexResponse create (
189+ org .elasticsearch .action .admin .indices .create .CreateIndexRequest createIndexRequest ,
190+ RequestOptions options ) throws IOException {
191+ return restHighLevelClient .performRequestAndParseEntity (createIndexRequest ,
192+ IndicesRequestConverters ::createIndex , options ,
193+ org .elasticsearch .action .admin .indices .create .CreateIndexResponse ::fromXContent , emptySet ());
194+ }
195+
168196 /**
169197 * Asynchronously creates an index using the Create Index API.
170198 * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html">
@@ -173,20 +201,47 @@ public CreateIndexResponse create(CreateIndexRequest createIndexRequest, Header.
173201 * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
174202 * @param listener the listener to be notified upon request completion
175203 */
176- public void createAsync (CreateIndexRequest createIndexRequest , RequestOptions options , ActionListener <CreateIndexResponse > listener ) {
204+ public void createAsync (CreateIndexRequest createIndexRequest ,
205+ RequestOptions options ,
206+ ActionListener <CreateIndexResponse > listener ) {
177207 restHighLevelClient .performRequestAsyncAndParseEntity (createIndexRequest , IndicesRequestConverters ::createIndex , options ,
178- CreateIndexResponse ::fromXContent , listener , emptySet ());
208+ CreateIndexResponse ::fromXContent , listener , emptySet ());
209+ }
210+
211+ /**
212+ * Asynchronously creates an index using the Create Index API.
213+ * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html">
214+ * Create Index API on elastic.co</a>
215+ * @param createIndexRequest the request
216+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
217+ * @param listener the listener to be notified upon request completion
218+ *
219+ * @deprecated This method uses an old request object which still refers to types, a deprecated feature. The
220+ * method {@link #createAsync(CreateIndexRequest, RequestOptions, ActionListener)} should be used instead,
221+ * which accepts a new request object.
222+ */
223+ @ Deprecated
224+ public void createAsync (org .elasticsearch .action .admin .indices .create .CreateIndexRequest createIndexRequest ,
225+ RequestOptions options ,
226+ ActionListener <org .elasticsearch .action .admin .indices .create .CreateIndexResponse > listener ) {
227+ restHighLevelClient .performRequestAsyncAndParseEntity (createIndexRequest ,
228+ IndicesRequestConverters ::createIndex , options ,
229+ org .elasticsearch .action .admin .indices .create .CreateIndexResponse ::fromXContent , listener , emptySet ());
179230 }
180231
181232 /**
182233 * Asynchronously creates an index using the Create Index API.
183234 * <p>
184235 * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html">
185236 * Create Index API on elastic.co</a>
186- * @deprecated Prefer {@link #createAsync(CreateIndexRequest, RequestOptions, ActionListener)}
237+ *
238+ * @deprecated This method uses an old request object which still refers to types, a deprecated feature. The
239+ * method {@link #createAsync(CreateIndexRequest, RequestOptions, ActionListener)} should be used instead,
240+ * which accepts a new request object and also uses request objects instead of headers.
187241 */
188242 @ Deprecated
189- public void createAsync (CreateIndexRequest createIndexRequest , ActionListener <CreateIndexResponse > listener , Header ... headers ) {
243+ public void createAsync (org .elasticsearch .action .admin .indices .create .CreateIndexRequest createIndexRequest ,
244+ ActionListener <CreateIndexResponse > listener , Header ... headers ) {
190245 restHighLevelClient .performRequestAsyncAndParseEntity (createIndexRequest , IndicesRequestConverters ::createIndex ,
191246 CreateIndexResponse ::fromXContent , listener , emptySet (), headers );
192247 }
0 commit comments