|
34 | 34 | import org.elasticsearch.action.admin.indices.flush.SyncedFlushRequest; |
35 | 35 | import org.elasticsearch.action.admin.indices.forcemerge.ForceMergeRequest; |
36 | 36 | import org.elasticsearch.action.admin.indices.forcemerge.ForceMergeResponse; |
37 | | -import org.elasticsearch.action.admin.indices.get.GetIndexRequest; |
38 | | -import org.elasticsearch.action.admin.indices.get.GetIndexResponse; |
39 | | -import org.elasticsearch.client.indices.GetFieldMappingsRequest; |
40 | | -import org.elasticsearch.client.indices.GetFieldMappingsResponse; |
41 | 37 | import org.elasticsearch.action.admin.indices.open.OpenIndexRequest; |
42 | 38 | import org.elasticsearch.action.admin.indices.open.OpenIndexResponse; |
43 | 39 | import org.elasticsearch.action.admin.indices.refresh.RefreshRequest; |
|
59 | 55 | import org.elasticsearch.client.indices.CreateIndexRequest; |
60 | 56 | import org.elasticsearch.client.indices.CreateIndexResponse; |
61 | 57 | import org.elasticsearch.client.indices.FreezeIndexRequest; |
| 58 | +import org.elasticsearch.client.indices.GetFieldMappingsRequest; |
| 59 | +import org.elasticsearch.client.indices.GetFieldMappingsResponse; |
| 60 | +import org.elasticsearch.client.indices.GetIndexRequest; |
| 61 | +import org.elasticsearch.client.indices.GetIndexResponse; |
62 | 62 | import org.elasticsearch.client.indices.GetIndexTemplatesRequest; |
63 | 63 | import org.elasticsearch.client.indices.GetMappingsRequest; |
64 | 64 | import org.elasticsearch.client.indices.GetMappingsResponse; |
@@ -901,6 +901,41 @@ public void getAsync(GetIndexRequest getIndexRequest, RequestOptions options, |
901 | 901 | GetIndexResponse::fromXContent, listener, emptySet()); |
902 | 902 | } |
903 | 903 |
|
| 904 | + /** |
| 905 | + * Retrieve information about one or more indexes |
| 906 | + * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-index.html"> |
| 907 | + * Indices Get Index API on elastic.co</a> |
| 908 | + * @param getIndexRequest the request |
| 909 | + * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized |
| 910 | + * @return the response |
| 911 | + * @throws IOException in case there is a problem sending the request or parsing back the response |
| 912 | + * @deprecated This method uses an old request object which still refers to types, a deprecated feature. The method |
| 913 | + * {@link #get(GetIndexRequest, RequestOptions)} should be used instead, which accepts a new request object. |
| 914 | + */ |
| 915 | + @Deprecated |
| 916 | + public org.elasticsearch.action.admin.indices.get.GetIndexResponse get( |
| 917 | + org.elasticsearch.action.admin.indices.get.GetIndexRequest getIndexRequest, RequestOptions options) throws IOException { |
| 918 | + return restHighLevelClient.performRequestAndParseEntity(getIndexRequest, IndicesRequestConverters::getIndex, options, |
| 919 | + org.elasticsearch.action.admin.indices.get.GetIndexResponse::fromXContent, emptySet()); |
| 920 | + } |
| 921 | + |
| 922 | + /** |
| 923 | + * Retrieve information about one or more indexes |
| 924 | + * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-index.html"> |
| 925 | + * Indices Get Index API on elastic.co</a> |
| 926 | + * @param getIndexRequest the request |
| 927 | + * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized |
| 928 | + * @param listener the listener to be notified upon request completion |
| 929 | + * @deprecated This method uses an old request object which still refers to types, a deprecated feature. The method |
| 930 | + * {@link #getAsync(GetIndexRequest, RequestOptions, ActionListener)} should be used instead, which accepts a new request object. |
| 931 | + */ |
| 932 | + @Deprecated |
| 933 | + public void getAsync(org.elasticsearch.action.admin.indices.get.GetIndexRequest getIndexRequest, RequestOptions options, |
| 934 | + ActionListener<org.elasticsearch.action.admin.indices.get.GetIndexResponse> listener) { |
| 935 | + restHighLevelClient.performRequestAsyncAndParseEntity(getIndexRequest, IndicesRequestConverters::getIndex, options, |
| 936 | + org.elasticsearch.action.admin.indices.get.GetIndexResponse::fromXContent, listener, emptySet()); |
| 937 | + } |
| 938 | + |
904 | 939 | /** |
905 | 940 | * Force merge one or more indices using the Force Merge API. |
906 | 941 | * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-forcemerge.html"> |
@@ -1058,15 +1093,38 @@ public boolean exists(GetIndexRequest request, RequestOptions options) throws IO |
1058 | 1093 | ); |
1059 | 1094 | } |
1060 | 1095 |
|
| 1096 | + /** |
| 1097 | + * Checks if the index (indices) exists or not. |
| 1098 | + * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-exists.html"> |
| 1099 | + * Indices Exists API on elastic.co</a> |
| 1100 | + * @param request the request |
| 1101 | + * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized |
| 1102 | + * @return the response |
| 1103 | + * @throws IOException in case there is a problem sending the request |
| 1104 | + * @deprecated This method uses an old request object which still refers to types, a deprecated feature. The method |
| 1105 | + * {@link #exists(GetIndexRequest, RequestOptions)} should be used instead, which accepts a new request object. |
| 1106 | + */ |
| 1107 | + @Deprecated |
| 1108 | + public boolean exists(org.elasticsearch.action.admin.indices.get.GetIndexRequest request, RequestOptions options) throws IOException { |
| 1109 | + return restHighLevelClient.performRequest( |
| 1110 | + request, |
| 1111 | + IndicesRequestConverters::indicesExist, |
| 1112 | + options, |
| 1113 | + RestHighLevelClient::convertExistsResponse, |
| 1114 | + Collections.emptySet() |
| 1115 | + ); |
| 1116 | + } |
| 1117 | + |
1061 | 1118 | /** |
1062 | 1119 | * Checks if the index (indices) exists or not. |
1063 | 1120 | * <p> |
1064 | 1121 | * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-exists.html"> |
1065 | 1122 | * Indices Exists API on elastic.co</a> |
1066 | | - * @deprecated Prefer {@link #exists(GetIndexRequest, RequestOptions)} |
| 1123 | + * @deprecated This method uses an old request object which still refers to types, a deprecated feature. The method |
| 1124 | + * {@link #exists(GetIndexRequest, RequestOptions)} should be used instead, which accepts a new request object. |
1067 | 1125 | */ |
1068 | 1126 | @Deprecated |
1069 | | - public boolean exists(GetIndexRequest request, Header... headers) throws IOException { |
| 1127 | + public boolean exists(org.elasticsearch.action.admin.indices.get.GetIndexRequest request, Header... headers) throws IOException { |
1070 | 1128 | return restHighLevelClient.performRequest( |
1071 | 1129 | request, |
1072 | 1130 | IndicesRequestConverters::indicesExist, |
@@ -1095,15 +1153,40 @@ public void existsAsync(GetIndexRequest request, RequestOptions options, ActionL |
1095 | 1153 | ); |
1096 | 1154 | } |
1097 | 1155 |
|
| 1156 | + /** |
| 1157 | + * Asynchronously checks if the index (indices) exists or not. |
| 1158 | + * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-exists.html"> |
| 1159 | + * Indices Exists API on elastic.co</a> |
| 1160 | + * @param request the request |
| 1161 | + * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized |
| 1162 | + * @param listener the listener to be notified upon request completion |
| 1163 | + * @deprecated This method uses an old request object which still refers to types, a deprecated feature. The method |
| 1164 | + * {@link #existsAsync(GetIndexRequest, RequestOptions, ActionListener)} should be used instead, which accepts a new request object. |
| 1165 | + */ |
| 1166 | + @Deprecated |
| 1167 | + public void existsAsync(org.elasticsearch.action.admin.indices.get.GetIndexRequest request, RequestOptions options, |
| 1168 | + ActionListener<Boolean> listener) { |
| 1169 | + restHighLevelClient.performRequestAsync( |
| 1170 | + request, |
| 1171 | + IndicesRequestConverters::indicesExist, |
| 1172 | + options, |
| 1173 | + RestHighLevelClient::convertExistsResponse, |
| 1174 | + listener, |
| 1175 | + Collections.emptySet() |
| 1176 | + ); |
| 1177 | + } |
| 1178 | + |
1098 | 1179 | /** |
1099 | 1180 | * Asynchronously checks if the index (indices) exists or not. |
1100 | 1181 | * <p> |
1101 | 1182 | * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-exists.html"> |
1102 | 1183 | * Indices Exists API on elastic.co</a> |
1103 | | - * @deprecated Prefer {@link #existsAsync(GetIndexRequest, RequestOptions, ActionListener)} |
| 1184 | + * @deprecated This method uses an old request object which still refers to types, a deprecated feature. The method |
| 1185 | + * {@link #existsAsync(GetIndexRequest, RequestOptions, ActionListener)} should be used instead, which accepts a new request object. |
1104 | 1186 | */ |
1105 | 1187 | @Deprecated |
1106 | | - public void existsAsync(GetIndexRequest request, ActionListener<Boolean> listener, Header... headers) { |
| 1188 | + public void existsAsync(org.elasticsearch.action.admin.indices.get.GetIndexRequest request, ActionListener<Boolean> listener, |
| 1189 | + Header... headers) { |
1107 | 1190 | restHighLevelClient.performRequestAsync( |
1108 | 1191 | request, |
1109 | 1192 | IndicesRequestConverters::indicesExist, |
|
0 commit comments