How to Set Up Third-Party Search
Algolia
The following instructions are for Algolia. We may provide other third-party search tool options in the future.
Create an index
Whether you are managing search yourself or having Stanford Web Services help you implement search, you will need to start by getting an account and creating a search index.
- Create your account for Algolia by going to https://dashboard.algolia.com/users/sign_up. We recommend using Google sign-in and your stanford.edu account.
- Agree to Algolia’s Terms and Conditions and answer their personalized experience questions.
- You will get a Welcome to Algolia popup. Dismiss this by clicking No thanks, I’ll browse on my own.
- You will get an Application called "My First Application." Rename that application to something meaningful. From the Index drop-down, select Create Index. Remember the index name! You will need it when you Add the index to your site (see below.)
- Click Upgrade and enter your payment information. Most sites on Stanford Sites can use the Grow plan.
If you already have an Algolia account, and need to add an index for an additional site, the steps are a bit simpler:
- Log into Algolia.
- Select Search in the sidebar.
- Choose your Application from the drop-down at the top. (If the users and payment for this site are similar to your other sites, you can choose an existing application. If not, you may want to set up a new application.)
- From the Index drop-down, select Create Index.
- Give your index a name that describes where it will be used (for example
sws_sitesuserguide
.) - Remember the index name! You will need it when you Add index to your site (see below.)
For central support
If you are working with Stanford Web Services to add search to your site, you will need to grant us access to your search index. To do so, follow these steps
- Go to Settings in the sidebar.
- Go to Team and Access>Team.
- Click Add Team Member:
- Add swsdevelopers@gmail.com
- If you have more than one application or index, make sure you select the correct indices
- Toggle the switch that gives swsdevelopers@gmail.com “Access to all permissions”
- You may also want to add other members of your team at this point or you can do it later
- Click the Add button
- Notify your Stanford Web Services contact that this step is complete
Once we have access we can hook up the new search index to your site. We will also walk you through common customizations.
For self-service users
To set up your site to use your new search index, you will first need to get information from Algolia:
- Log into Algolia.
- Go to Settings in the left sidebar.
- Click on Team and Access>API Keys.
- For the next step you are going to need to copy these items:
- Application ID
- Write API Key
- Search Index
- You will also need the name of your index, which you created in a previous step.
Add the index to your site
To configure the Stanford Sites site or Stanford Sites Intranet Site to use Algolia, do the following. These steps start the indexing process, which can be done separately from using the search on your site. See the section Enable or disable Algolia Search for information on swapping out the Drupal search with Algolia search.
- Navigate to Configuration>System>Site Settings on your Stanford Site or Stanford Sites Intranet.
- Click on the Search tab.
- Check the box that says Index Content with Algolia.
- Fill in the Application ID from Algolia in the Algolia Application ID field.
- Fill in the Write API Key in the field called Algolia API Key field.
- Fill in the Search API Key in the field called Algolia Search Only Key field.
- Fill in the Index name in the Algolia Search Index field.
- Click Save.
Create the index
Once connected, your index will start to build automatically. It will be updated once a day to collect any new pages or page changes.
You can check on what is in your index by logging onto Algolia and going to Search>Index>Browse. You can perform searches here. The results will reflect what users will see on your site. We recommend waiting until the index is complete before turning Algolia on as your site search.
We may provide the ability to manually re-index the site (stay tuned!)
Enable or disable Algolia search
Once you have completed the steps above, you can enable or disable using Algolia as your site search.
- Navigate to Configuration>System>Site Settings on your Stanford Site or Stanford Sites Intranet.
- Click on the Search tab.
- Check the box that says Algolia Searching UI.
You can disable the Algolia search and go back to Drupal Search at any time by unchecking the box for Algolia Searching UI. If you plan to discontinue using Algolia altogether, you will need to also need to uncheck Index Content with Algolia.
Known Issues
- Currently deleted pages may not be removed from your index. You can remove them manually in the Algolia interface OR submit a help request to reindex your site.