Standalone solution for search index, product, and path-prefix mapping
#developer.adobe.com search guide Feb 2023:
Our app points search iframe source to:
https://developer.adobe.com/search-frame/ on prod, https://developer-stage.adobe.com/search-frame/ on stage, and http://localhost:8000/ when running locally.
The iframed instance should be running https://github.com/AdobeDocs/search-iframe with enabled search using the Gatsby config in the next section.
Note: The aio-theme layout component checks for /search-frame/
pathPrefix to toggle the search iframe ready layout.
Add relevant [app id] and [api key] from Algolia to the repo's .env file
GATSBY_ALGOLIA_APPLICATION_ID=[app id here]
GATSBY_ALGOLIA_SEARCH_API_KEY=[api key here]
https://github.com/AdobeDocs/search-indices/blob/main/product-index-map.json
Format the index with it's relevant pathPrefix like so:
{
"indexName": "photoshop",
"indexPathPrefix": "/photoshop/"
}
Find the relevant Product Name and add the index object to the productIndices array like so:
{
"productName": "Adobe Photoshop",
"productIndices": [
{
"indexName": "photoshop",
"indexPathPrefix": "/photoshop/"
},
{
"indexName": "uxp-photoshop",
"indexPathPrefix": "/photoshop/uxp/2022/"
},
{
"indexName": "uxp-photoshop-2021",
"indexPathPrefix": "/photoshop/uxp/2021/"
},
{
"indexName": "cis-photoshop-api-docs",
"indexPathPrefix": "/photoshop/photoshop-api-docs/"
},
{
"indexName": "photoshop-api",
"indexPathPrefix": "/photoshop/api/"
}
]
},
If relevant product is missing add it to the top array.
Franklin indexer: https://github.com/adobe/adobe-io-website/tree/algolia-indexing-fix/.algolia
The aio-theme indexer triggers during yarn build
and behaves differently based on .env configuration.
Add relevant [app id] and [api WRITE key] from Algolia to the repo's .env file and the following variables
ALGOLIA_INDEXATION_MODE="index"
GATSBY_SITE_DOMAIN_URL="https://developer.adobe.com"
GATSBY_ALGOLIA_APPLICATION_ID=[app id here]
GATSBY_ALGOLIA_INDEX_NAME=[repo name]
ALGOLIA_WRITE_API_KEY=[api WRITE key]
REPO_NAME=[repo name]
ALGOLIA_INDEXATION_MODE=[ "index" | "console" | "skip" ]
"index" to push indices to Algolia
"console" to do a dry run in console
"skip" to skip indexing.
Add GATSBY_ALGOLIA_INDEX_ENV_PREFIX: ${{ secrets.AIO_ALGOLIA_INDEX_ENV_PREFIX }}
to prod and dev build actions
Add GATSBY_ALGOLIA_INDEX_ENV_PREFIX=[ prod | stage | * ]
to .env
Leave secrets.AIO_ALGOLIA_INDEX_ENV_PREFIX
blank for deployment
Leave GATSBY_ALGOLIA_INDEX_ENV_PREFIX
blank for testing on localhost