1 /**
2 * @oas [delete] /admin/search-indexes/{id}
3 * operationId: DeleteSearchIndexesId
4 * summary: Delete a Search Index
5 * description: Delete a search index and every physical index built for it in the search engine. The index's definition isn't removed, so the next time search index migrations run, the index is built
6 * again from scratch at version 1.
7 * externalDocs:
8 * description: Learn about reindexing and index migrations
9 * url: https://docs.medusajs.com/resources/infrastructure-modules/search/reindexing
10 * x-authenticated: true
11 * parameters:
12 * - name: id
13 * in: path
14 * description: The search index's name, such as `product`.
15 * required: true
16 * schema:
17 * type: string
18 * security:
19 * - api_token: []
20 * - cookie_auth: []
21 * - jwt_token: []
22 * x-codeSamples:
23 * - lang: JavaScript
24 * label: JS SDK
25 * source: |-
26 * import Medusa from "@medusajs/js-sdk"
27 *
28 * export const sdk = new Medusa({
29 * baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
30 * debug: import.meta.env.DEV,
31 * auth: {
32 * type: "session",
33 * },
34 * })
35 *
36 * sdk.admin.search.deleteIndex("product")
37 * .then(({ deleted, deleted_versions }) => {
38 * console.log(deleted, deleted_versions)
39 * })
40 * - lang: Shell
41 * label: cURL
42 * source: |-
43 * curl -X DELETE '{backend_url}/admin/search-indexes/{id}' \
44 * -H 'Authorization: Bearer {access_token}'
45 * tags:
46 * - Search Indexes
47 * responses:
48 * "200":
49 * description: OK
50 * content:
51 * application/json:
52 * schema:
53 * $ref: "#/components/schemas/AdminSearchIndexDeleteResponse"
54 * "400":
55 * $ref: "#/components/responses/400_error"
56 * "401":
57 * $ref: "#/components/responses/unauthorized"
58 * "404":
59 * $ref: "#/components/responses/not_found_error"
60 * "409":
61 * $ref: "#/components/responses/invalid_state_error"
62 * "422":
63 * $ref: "#/components/responses/invalid_request_error"
64 * "500":
65 * $ref: "#/components/responses/500_error"
66 * x-workflow: deleteSearchIndexWorkflow
67 * x-events: []
68 *
69 */
70