3939import org .elasticsearch .action .admin .indices .get .GetIndexResponse ;
4040import org .elasticsearch .client .indices .GetFieldMappingsRequest ;
4141import org .elasticsearch .client .indices .GetFieldMappingsResponse ;
42- import org .elasticsearch .action .admin .indices .mapping .get .GetMappingsRequest ;
43- import org .elasticsearch .action .admin .indices .mapping .get .GetMappingsResponse ;
4442import org .elasticsearch .action .admin .indices .open .OpenIndexRequest ;
4543import org .elasticsearch .action .admin .indices .open .OpenIndexResponse ;
4644import org .elasticsearch .action .admin .indices .refresh .RefreshRequest ;
6159import org .elasticsearch .client .core .ShardsAcknowledgedResponse ;
6260import org .elasticsearch .client .indices .FreezeIndexRequest ;
6361import org .elasticsearch .client .indices .GetIndexTemplatesRequest ;
62+ import org .elasticsearch .client .indices .GetMappingsRequest ;
63+ import org .elasticsearch .client .indices .GetMappingsResponse ;
6464import org .elasticsearch .client .indices .IndexTemplatesExistRequest ;
6565import org .elasticsearch .client .indices .PutMappingRequest ;
6666import org .elasticsearch .client .indices .UnfreezeIndexRequest ;
@@ -215,8 +215,11 @@ public void putMappingAsync(org.elasticsearch.action.admin.indices.mapping.put.P
215215 * @throws IOException in case there is a problem sending the request or parsing back the response
216216 */
217217 public GetMappingsResponse getMapping (GetMappingsRequest getMappingsRequest , RequestOptions options ) throws IOException {
218- return restHighLevelClient .performRequestAndParseEntity (getMappingsRequest , IndicesRequestConverters ::getMappings , options ,
219- GetMappingsResponse ::fromXContent , emptySet ());
218+ return restHighLevelClient .performRequestAndParseEntity (getMappingsRequest ,
219+ IndicesRequestConverters ::getMappings ,
220+ options ,
221+ GetMappingsResponse ::fromXContent ,
222+ emptySet ());
220223 }
221224
222225 /**
@@ -229,8 +232,60 @@ public GetMappingsResponse getMapping(GetMappingsRequest getMappingsRequest, Req
229232 */
230233 public void getMappingAsync (GetMappingsRequest getMappingsRequest , RequestOptions options ,
231234 ActionListener <GetMappingsResponse > listener ) {
232- restHighLevelClient .performRequestAsyncAndParseEntity (getMappingsRequest , IndicesRequestConverters ::getMappings , options ,
233- GetMappingsResponse ::fromXContent , listener , emptySet ());
235+ restHighLevelClient .performRequestAsyncAndParseEntity (getMappingsRequest ,
236+ IndicesRequestConverters ::getMappings ,
237+ options ,
238+ GetMappingsResponse ::fromXContent ,
239+ listener ,
240+ emptySet ());
241+ }
242+
243+ /**
244+ * Retrieves the mappings on an index or indices using the Get Mapping API.
245+ * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-mapping.html">
246+ * Get Mapping API on elastic.co</a>
247+ * @param getMappingsRequest the request
248+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
249+ * @return the response
250+ * @throws IOException in case there is a problem sending the request or parsing back the response
251+ *
252+ * @deprecated This method uses an old request and response objects which still refer to types, a deprecated
253+ * feature. The method {@link #getMapping(GetMappingsRequest, RequestOptions)} should be used instead, which
254+ * accepts a new request object.
255+ */
256+ @ Deprecated
257+ public org .elasticsearch .action .admin .indices .mapping .get .GetMappingsResponse getMapping (
258+ org .elasticsearch .action .admin .indices .mapping .get .GetMappingsRequest getMappingsRequest ,
259+ RequestOptions options ) throws IOException {
260+ return restHighLevelClient .performRequestAndParseEntity (getMappingsRequest ,
261+ IndicesRequestConverters ::getMappings ,
262+ options ,
263+ org .elasticsearch .action .admin .indices .mapping .get .GetMappingsResponse ::fromXContent ,
264+ emptySet ());
265+ }
266+
267+ /**
268+ * Asynchronously retrieves the mappings on an index on indices using the Get Mapping API.
269+ * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-mapping.html">
270+ * Get Mapping API on elastic.co</a>
271+ * @param getMappingsRequest the request
272+ * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
273+ * @param listener the listener to be notified upon request completion
274+ *
275+ * @deprecated This method uses old request and response objects which still refer to types, a deprecated feature.
276+ * The method {@link #getMapping(GetMappingsRequest, RequestOptions)} should be used instead, which accepts a new
277+ * request object.
278+ */
279+ @ Deprecated
280+ public void getMappingAsync (org .elasticsearch .action .admin .indices .mapping .get .GetMappingsRequest getMappingsRequest ,
281+ RequestOptions options ,
282+ ActionListener <org .elasticsearch .action .admin .indices .mapping .get .GetMappingsResponse > listener ) {
283+ restHighLevelClient .performRequestAsyncAndParseEntity (getMappingsRequest ,
284+ IndicesRequestConverters ::getMappings ,
285+ options ,
286+ org .elasticsearch .action .admin .indices .mapping .get .GetMappingsResponse ::fromXContent ,
287+ listener ,
288+ emptySet ());
234289 }
235290
236291 /**
@@ -242,8 +297,9 @@ public void getMappingAsync(GetMappingsRequest getMappingsRequest, RequestOption
242297 * @return the response
243298 * @throws IOException in case there is a problem sending the request or parsing back the response
244299 *
245- * @deprecated This method uses an old request object which still refers to types, a deprecated feature. The method
246- * {@link #getFieldMapping(GetFieldMappingsRequest, RequestOptions)} should be used instead, which accepts a new request object.
300+ * @deprecated This method uses old request and response objects which still refer to types, a deprecated feature.
301+ * The method {@link #getFieldMapping(GetFieldMappingsRequest, RequestOptions)} should be used instead, which
302+ * accepts a new request object.
247303 */
248304 @ Deprecated
249305 public org .elasticsearch .action .admin .indices .mapping .get .GetFieldMappingsResponse getFieldMapping (
@@ -261,9 +317,9 @@ public org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsRespon
261317 * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
262318 * @param listener the listener to be notified upon request completion
263319 *
264- * @deprecated This method uses an old request object which still refers to types, a deprecated feature. The
265- * method {@link #getFieldMappingAsync(GetFieldMappingsRequest, RequestOptions, ActionListener)} should be used instead,
266- * which accepts a new request object.
320+ * @deprecated This method uses an request and response objects which still refers to types, a deprecated feature.
321+ * The method {@link #getFieldMappingAsync(GetFieldMappingsRequest, RequestOptions, ActionListener)} should be
322+ * used instead, which accepts a new request object.
267323 */
268324 @ Deprecated
269325 public void getFieldMappingAsync (org .elasticsearch .action .admin .indices .mapping .get .GetFieldMappingsRequest getFieldMappingsRequest ,
0 commit comments