@@ -172,7 +172,7 @@ Object createDocument(
172172
173173 /** Delete all items from a given grounding document collection. */
174174 @ GetMapping ("/vector/collection/by-id/{id}/clear" )
175- Object deleteDocuments (
175+ Object deleteCollection (
176176 @ Nonnull @ PathVariable ("id" ) final UUID collectionId ,
177177 @ Nullable @ RequestParam (value = "format" , required = false ) final String format ) {
178178 final var dayOfWeek = now ().getDayOfWeek ().getDisplayName (TextStyle .FULL , Locale .ENGLISH );
@@ -192,7 +192,6 @@ Object deleteDocuments(
192192 if (del .getStatusCode () >= 400 ) {
193193 final var msg = "Document {} could not be deleted, status code [{}], headers: {}" ;
194194 log .error (msg , documentId , del .getStatusCode (), del .getHeaders ());
195- throw new IllegalStateException ("Document deletion failed for id " + documentId );
196195 }
197196 }
198197 final var response = CLIENT_VECTOR .deleteCollectionById (RESOURCE_GROUP , collectionId + "" );
@@ -225,15 +224,11 @@ Object deleteCollections(
225224 final var collectionsList = ((CollectionsListResponse ) collections ).getResources ();
226225 var statusCode = 0 ;
227226 final var deletions = new java .util .ArrayList <>(List .of ());
228-
229227 for (final var collection : collectionsList ) {
230228 if (COLLECTION_TITLE .equals (collection .getTitle ())) {
231- final var deletion = this .deleteDocuments (collection .getId (), "json" );
232- if (deletion instanceof OpenApiResponse ) {
233- final var status = ((OpenApiResponse ) deletion ).getStatusCode ();
234- deletions .add (deletion );
235- statusCode = Math .max (status , statusCode );
236- }
229+ final var deletion = (OpenApiResponse ) this .deleteCollection (collection .getId (), "json" );
230+ deletions .add (deletion );
231+ statusCode = Math .max (deletion .getStatusCode (), statusCode );
237232 }
238233 }
239234 if ("json" .equals (format )) {
0 commit comments