Commit 7e4d851
Merge #907
907: Add support for custom metadata in document operations r=curquiza a=Osireg17
# Pull Request
## Related issue
Fixes #905
## What does this PR do?
This pull request adds support for passing custom metadata when performing document operations in the Meilisearch Java SDK. The main changes include updating the `Documents` and `Index` classes to accept an optional `customMetadata` parameter for add, update, and delete operations, storing this metadata in the `Task` model, and introducing comprehensive integration tests to validate the new functionality.
### Model changes
* Updated the `Task` model (`Task.java`) to include a `customMetadata` field, ensuring that metadata attached to tasks is stored and accessible.
### Test coverage
* Added multiple integration tests in `DocumentsTest.java` to verify that custom metadata is correctly attached and retrievable for all document operations (add, update, delete single, delete batch, delete by filter, delete all).
## PR checklist
Please check if your PR fulfills the following requirements:
- [ ] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
- [x] Have you read the contributing guidelines?
- [ ] Have you made sure that the title is accurate and descriptive of the changes?
Thank you so much for contributing to Meilisearch!
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **New Features**
* Added support for custom metadata across all document operations including add, update, single/batch delete, filter-based delete, and delete-all operations. Custom metadata can now be attached to document operations and is included in task responses.
<sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: Osi Obomighie <93836683+Osireg17@users.noreply.github.com>File tree
4 files changed
+358
-2
lines changed- src
- main/java/com/meilisearch/sdk
- model
- test/java/com/meilisearch/integration
4 files changed
+358
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
164 | 185 | | |
165 | 186 | | |
166 | 187 | | |
167 | 188 | | |
168 | 189 | | |
169 | 190 | | |
170 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
171 | 195 | | |
172 | 196 | | |
173 | 197 | | |
| |||
182 | 206 | | |
183 | 207 | | |
184 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
185 | 230 | | |
186 | 231 | | |
187 | 232 | | |
188 | 233 | | |
189 | 234 | | |
190 | 235 | | |
191 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
192 | 240 | | |
193 | 241 | | |
194 | 242 | | |
| |||
201 | 249 | | |
202 | 250 | | |
203 | 251 | | |
204 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
205 | 271 | | |
206 | 272 | | |
207 | 273 | | |
| |||
213 | 279 | | |
214 | 280 | | |
215 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
216 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
217 | 300 | | |
218 | 301 | | |
219 | 302 | | |
| |||
226 | 309 | | |
227 | 310 | | |
228 | 311 | | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
229 | 326 | | |
230 | 327 | | |
231 | 328 | | |
232 | 329 | | |
233 | 330 | | |
234 | 331 | | |
235 | 332 | | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
236 | 336 | | |
237 | 337 | | |
238 | 338 | | |
| |||
244 | 344 | | |
245 | 345 | | |
246 | 346 | | |
247 | | - | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
248 | 364 | | |
249 | 365 | | |
250 | 366 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
207 | 227 | | |
208 | 228 | | |
209 | 229 | | |
| |||
298 | 318 | | |
299 | 319 | | |
300 | 320 | | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
301 | 341 | | |
302 | 342 | | |
303 | 343 | | |
| |||
359 | 399 | | |
360 | 400 | | |
361 | 401 | | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
362 | 418 | | |
363 | 419 | | |
364 | 420 | | |
| |||
375 | 431 | | |
376 | 432 | | |
377 | 433 | | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
378 | 452 | | |
379 | 453 | | |
380 | 454 | | |
| |||
390 | 464 | | |
391 | 465 | | |
392 | 466 | | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
393 | 484 | | |
394 | 485 | | |
395 | 486 | | |
| |||
403 | 494 | | |
404 | 495 | | |
405 | 496 | | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
406 | 511 | | |
407 | 512 | | |
408 | 513 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
0 commit comments