3
3
import static java .util .Collections .singletonList ;
4
4
5
5
import com .meilisearch .sdk .exceptions .MeilisearchException ;
6
- import com .meilisearch .sdk .model .Task ;
6
+ import com .meilisearch .sdk .model .TaskInfo ;
7
7
import java .util .List ;
8
8
9
9
/**
@@ -106,15 +106,16 @@ String getDocuments(String uid, int limit, int offset, List<String> attributesTo
106
106
* @param uid Partial index identifier for the document
107
107
* @param document String containing the document to add
108
108
* @param primaryKey PrimaryKey of the document
109
- * @return Meilisearch's Task API response
109
+ * @return Meilisearch's TaskInfo API response
110
110
* @throws MeilisearchException if the client request causes an error
111
111
*/
112
- Task addDocuments (String uid , String document , String primaryKey ) throws MeilisearchException {
112
+ TaskInfo addDocuments (String uid , String document , String primaryKey )
113
+ throws MeilisearchException {
113
114
String urlQuery = "/indexes/" + uid + "/documents" ;
114
115
if (primaryKey != null ) {
115
116
urlQuery += "?primaryKey=" + primaryKey ;
116
117
}
117
- return httpClient .post (urlQuery , document , Task .class );
118
+ return httpClient .post (urlQuery , document , TaskInfo .class );
118
119
}
119
120
120
121
/**
@@ -123,53 +124,53 @@ Task addDocuments(String uid, String document, String primaryKey) throws Meilise
123
124
* @param uid Partial index identifier for the document
124
125
* @param document String containing the document to replace the existing document
125
126
* @param primaryKey PrimaryKey of the document
126
- * @return Meilisearch's Task API response
127
+ * @return Meilisearch's TaskInfo API response
127
128
* @throws MeilisearchException if the client request causes an error
128
129
*/
129
- Task updateDocuments (String uid , String document , String primaryKey )
130
+ TaskInfo updateDocuments (String uid , String document , String primaryKey )
130
131
throws MeilisearchException {
131
132
String urlPath = "/indexes/" + uid + "/documents" ;
132
133
if (primaryKey != null ) {
133
134
urlPath += "?primaryKey=" + primaryKey ;
134
135
}
135
- return httpClient .put (urlPath , document , Task .class );
136
+ return httpClient .put (urlPath , document , TaskInfo .class );
136
137
}
137
138
138
139
/**
139
140
* Deletes the document at the specified index uid with the specified identifier
140
141
*
141
142
* @param uid Partial index identifier for the requested document
142
143
* @param identifier ID of the document
143
- * @return Meilisearch's Task API response
144
+ * @return Meilisearch's TaskInfo API response
144
145
* @throws MeilisearchException if the client request causes an error
145
146
*/
146
- Task deleteDocument (String uid , String identifier ) throws MeilisearchException {
147
+ TaskInfo deleteDocument (String uid , String identifier ) throws MeilisearchException {
147
148
String urlPath = "/indexes/" + uid + "/documents/" + identifier ;
148
- return httpClient .delete (urlPath , Task .class );
149
+ return httpClient .delete (urlPath , TaskInfo .class );
149
150
}
150
151
151
152
/**
152
153
* Deletes the documents at the specified index uid with the specified identifiers
153
154
*
154
155
* @param uid Partial index identifier for the requested documents
155
156
* @param identifiers ID of documents to delete
156
- * @return Meilisearch's Task API response
157
+ * @return Meilisearch's TaskInfo API response
157
158
* @throws MeilisearchException if the client request causes an error
158
159
*/
159
- Task deleteDocuments (String uid , List <String > identifiers ) throws MeilisearchException {
160
+ TaskInfo deleteDocuments (String uid , List <String > identifiers ) throws MeilisearchException {
160
161
String urlPath = "/indexes/" + uid + "/documents/" + "delete-batch" ;
161
- return httpClient .post (urlPath , identifiers , Task .class );
162
+ return httpClient .post (urlPath , identifiers , TaskInfo .class );
162
163
}
163
164
164
165
/**
165
166
* Deletes all documents at the specified index uid
166
167
*
167
168
* @param uid Partial index identifier for the requested documents
168
- * @return Meilisearch's Task API response
169
+ * @return Meilisearch's TaskInfo API response
169
170
* @throws MeilisearchException if the client request causes an error
170
171
*/
171
- Task deleteAllDocuments (String uid ) throws MeilisearchException {
172
+ TaskInfo deleteAllDocuments (String uid ) throws MeilisearchException {
172
173
String urlPath = "/indexes/" + uid + "/documents" ;
173
- return httpClient .delete (urlPath , Task .class );
174
+ return httpClient .delete (urlPath , TaskInfo .class );
174
175
}
175
176
}
0 commit comments