-
-
Save Shigawire/31329bcff3e7f393186472e48d4d5183 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: FAQ Export | |
published: true | |
listed: false | |
hande: faq-export | |
slug: faq-export | |
response_type: application/json | |
--- | |
{ | |
"requests": [ | |
{% for faq_entry in contents.faq_entries %} | |
{ | |
"action": "addObject", | |
"body": | |
{ | |
"objectID": "{{ faq_entry._id | escape }}", | |
"title": "{{ faq_entry.title | escape }}", | |
"body": "{{ faq_entry.body | strip_html | strip_newlines | escape }}", | |
"url": "https://<mysite>{% path_to faq_entry %}" | |
} | |
} | |
{% unless forloop.last %} | |
, | |
{% endunless %} | |
{% endfor %} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
APPLICATION_ID=ALGOLIA_APP_ID API_KEY=ALGOLIA_API_KEY | |
curl https://<mysite>/faq-entries-export > batchFile.json | |
curl -X POST \ | |
-H "X-Algolia-API-Key: ${API_KEY}" \ | |
-H "X-Algolia-Application-Id: ${APPLICATION_ID}" \ | |
--data-binary @batchFile.json \ | |
"https://${APPLICATION_ID}.algolia.net/1/indexes/<algolia_index>/batch" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment