Search Indexes API Routes
A search index stores the documents of an entity so they can be searched.
These API routes allow admin users to list the registered search indexes, rebuild them, and delete them.
GET /admin/search-indexes#
List Search Indexes
Retrieve the list of search indexes registered in your application, including each index's provider, lifecycle status, and the fields it stores. If the Search Module isn't installed in your application, enabled is false and search_indexes is an empty array.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Request examples
Responses
200 OK
search_indexesobject[]The registered search indexes.
search_indexesobject[]enabledbooleanfalse, search_indexes is an empty array.400, 401, 404, 409, 422, 500: an error response is returned.
DELETE /admin/search-indexes/{id}#
Delete a Search Index
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 again from scratch at version 1.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringproduct.Request examples
Responses
200 OK
idstringobjectstringDefault: "search_index"
deletedbooleandeleted_versionsnumber0 when the index is registered but was never migrated.400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/search-indexes/{id}/reindex#
Reindex a Search Index
Rebuild a search index's documents using the seed function of its index definition. The rebuild runs in the background, so the response is returned immediately with the ID of the triggered job. Use the List Search Indexes API route to check the index's status and know when the rebuild is done.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringproduct.Request body (application/json)
sincestringOptionalfilters, this always rebuilds the index in place, as a version built from a subset of documents is never swapped in.filtersobjectOptionalseed function of the index definition to rebuild only a subset of the index's documents. The accepted shape is defined by the index, such as { ids: ["prod_123"] } if the index supports it.strategy"swap" | "in_place"Optionalswap builds a new version of the index and swaps it in once it's ready, whereas in_place rewrites the version that's currently serving documents. This property is ignored, and the rebuild always runs in place, when filters or since is set.Default: "swap"
Request examples
Responses
202 OK
job_idstringindexesstring[]400, 401, 404, 409, 422, 500: an error response is returned.