Please note, this guide is specific to Nacelle V1, for V2 users please refer to our Ingestion API docs.
You may occasionally want to remove multiple entires from the Nacelle index. While our recommendation is to first have webhooks setup, and second use the re-index button to accomplish this, Nacelle does also support programmatically deleting entries. In this article we'll be removing content entries. Should you want to remove a product, or collection, the steps outlined below should still be relevant, with a few minor adjustments (for a list of all possible endpoint see the Data Ingestion docs).
To start, we'll be making a call to the following endpoint: https://v1.dilithiumindex.com/graphql/contentful/remove-entry
Next, we'll need to add the following headers, and their corresponding values:
- x-nacelle-space-id
- x-nacelle-space-token
- contentful-rest-endpoint (For this field, any value should work, I used "test.")
- Content-Type (Stick with the default "application/json.")
Finally, we'll create the mutation to delete an entry:
mutation deleteEntries {
deleteContent (input: {
cms: {
defaultLocale: "en-CA",
syncSource: "contentful",
syncSourceDomain: "yourContentfulSpaceId.master.contentful"
},
id: "yourContentfulSpaceId.master.contentful::contentType::the-page-handle::en-CA"
})
}
A couple of things to note regarding the mutation above:
- You'll need to update the `defaultLocale` and `syncSource` based on the content piece, and your CMS system.
- The `syncSourceDomain` can be found in the Nacelle Dashboard, simply click on any content entry, and search for "CMS Sync Source Domain."
- The `id` can also be found in the Nacelle Dashboard (or via and API call). To find it in the dashboard, search for "Id."
Following the steps above should allow you to programmatically remove one, or multiple content entries from the Nacelle index.
Comments
0 comments
Please sign in to leave a comment.