25
25
26
26
import co .elastic .clients .base .ApiClient ;
27
27
import co .elastic .clients .base .Transport ;
28
- import co .elastic .clients .elasticsearch .ElasticsearchException ;
28
+ import co .elastic .clients .elasticsearch ._types . ElasticsearchException ;
29
29
import co .elastic .clients .util .ObjectBuilder ;
30
30
import java .io .IOException ;
31
31
import java .util .concurrent .CompletableFuture ;
@@ -52,7 +52,8 @@ public ElasticsearchAsyncSearchAsyncClient(Transport transport) {
52
52
* on elastic.co</a>
53
53
*/
54
54
55
- public CompletableFuture <DeleteAsyncSearchResponse > delete (DeleteAsyncSearchRequest request ) throws IOException {
55
+ public CompletableFuture <DeleteAsyncSearchResponse > delete (DeleteAsyncSearchRequest request )
56
+ throws IOException , ElasticsearchException {
56
57
return this .transport .performRequestAsync (request , DeleteAsyncSearchRequest .ENDPOINT );
57
58
}
58
59
@@ -61,16 +62,16 @@ public CompletableFuture<DeleteAsyncSearchResponse> delete(DeleteAsyncSearchRequ
61
62
* request will be cancelled. Otherwise, the saved search results are deleted.
62
63
*
63
64
* @param fn
64
- * a function that initializes a freshly created builder. This
65
- * function can either return its builder argument after having set
66
- * its properties or return another builder.
65
+ * a function that initializes a builder to create the
66
+ * {@link DeleteAsyncSearchRequest}
67
67
* @see <a href=
68
68
* "https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html">Documentation
69
69
* on elastic.co</a>
70
70
*/
71
71
72
72
public final CompletableFuture <DeleteAsyncSearchResponse > delete (
73
- Function <DeleteAsyncSearchRequest .Builder , ObjectBuilder <DeleteAsyncSearchRequest >> fn ) throws IOException {
73
+ Function <DeleteAsyncSearchRequest .Builder , ObjectBuilder <DeleteAsyncSearchRequest >> fn )
74
+ throws IOException , ElasticsearchException {
74
75
return delete (fn .apply (new DeleteAsyncSearchRequest .Builder ()).build ());
75
76
}
76
77
@@ -86,7 +87,7 @@ public final CompletableFuture<DeleteAsyncSearchResponse> delete(
86
87
*/
87
88
88
89
public <TDocument > CompletableFuture <GetAsyncSearchResponse <TDocument >> get (GetAsyncSearchRequest request ,
89
- Class <TDocument > tDocumentClass ) throws IOException {
90
+ Class <TDocument > tDocumentClass ) throws IOException , ElasticsearchException {
90
91
return this .transport .performRequestAsync (request ,
91
92
GetAsyncSearchRequest .createGetEndpoint (getDeserializer (tDocumentClass )));
92
93
}
@@ -96,17 +97,16 @@ public <TDocument> CompletableFuture<GetAsyncSearchResponse<TDocument>> get(GetA
96
97
* its ID.
97
98
*
98
99
* @param fn
99
- * a function that initializes a freshly created builder. This
100
- * function can either return its builder argument after having set
101
- * its properties or return another builder.
100
+ * a function that initializes a builder to create the
101
+ * {@link GetAsyncSearchRequest}
102
102
* @see <a href=
103
103
* "https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html">Documentation
104
104
* on elastic.co</a>
105
105
*/
106
106
107
107
public final <TDocument > CompletableFuture <GetAsyncSearchResponse <TDocument >> get (
108
108
Function <GetAsyncSearchRequest .Builder , ObjectBuilder <GetAsyncSearchRequest >> fn ,
109
- Class <TDocument > tDocumentClass ) throws IOException {
109
+ Class <TDocument > tDocumentClass ) throws IOException , ElasticsearchException {
110
110
return get (fn .apply (new GetAsyncSearchRequest .Builder ()).build (), tDocumentClass );
111
111
}
112
112
@@ -122,7 +122,7 @@ public final <TDocument> CompletableFuture<GetAsyncSearchResponse<TDocument>> ge
122
122
*/
123
123
124
124
public <TDocument > CompletableFuture <StatusResponse <TDocument >> status (StatusRequest request ,
125
- Class <TDocument > tDocumentClass ) throws IOException {
125
+ Class <TDocument > tDocumentClass ) throws IOException , ElasticsearchException {
126
126
return this .transport .performRequestAsync (request ,
127
127
StatusRequest .createStatusEndpoint (getDeserializer (tDocumentClass )));
128
128
}
@@ -132,17 +132,16 @@ public <TDocument> CompletableFuture<StatusResponse<TDocument>> status(StatusReq
132
132
* ID.
133
133
*
134
134
* @param fn
135
- * a function that initializes a freshly created builder. This
136
- * function can either return its builder argument after having set
137
- * its properties or return another builder.
135
+ * a function that initializes a builder to create the
136
+ * {@link StatusRequest}
138
137
* @see <a href=
139
138
* "https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html">Documentation
140
139
* on elastic.co</a>
141
140
*/
142
141
143
142
public final <TDocument > CompletableFuture <StatusResponse <TDocument >> status (
144
143
Function <StatusRequest .Builder , ObjectBuilder <StatusRequest >> fn , Class <TDocument > tDocumentClass )
145
- throws IOException {
144
+ throws IOException , ElasticsearchException {
146
145
return status (fn .apply (new StatusRequest .Builder ()).build (), tDocumentClass );
147
146
}
148
147
@@ -157,7 +156,7 @@ public final <TDocument> CompletableFuture<StatusResponse<TDocument>> status(
157
156
*/
158
157
159
158
public <TDocument > CompletableFuture <SubmitResponse <TDocument >> submit (SubmitRequest request ,
160
- Class <TDocument > tDocumentClass ) throws IOException {
159
+ Class <TDocument > tDocumentClass ) throws IOException , ElasticsearchException {
161
160
return this .transport .performRequestAsync (request ,
162
161
SubmitRequest .createSubmitEndpoint (getDeserializer (tDocumentClass )));
163
162
}
@@ -166,17 +165,16 @@ public <TDocument> CompletableFuture<SubmitResponse<TDocument>> submit(SubmitReq
166
165
* Executes a search request asynchronously.
167
166
*
168
167
* @param fn
169
- * a function that initializes a freshly created builder. This
170
- * function can either return its builder argument after having set
171
- * its properties or return another builder.
168
+ * a function that initializes a builder to create the
169
+ * {@link SubmitRequest}
172
170
* @see <a href=
173
171
* "https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html">Documentation
174
172
* on elastic.co</a>
175
173
*/
176
174
177
175
public final <TDocument > CompletableFuture <SubmitResponse <TDocument >> submit (
178
176
Function <SubmitRequest .Builder , ObjectBuilder <SubmitRequest >> fn , Class <TDocument > tDocumentClass )
179
- throws IOException {
177
+ throws IOException , ElasticsearchException {
180
178
return submit (fn .apply (new SubmitRequest .Builder ()).build (), tDocumentClass );
181
179
}
182
180
0 commit comments