Setup and Configuration

Setup and Configuration

AI-powered search requires a one-time configuration step and periodic re-indexing when help content changes.

Setting the OpenAI API Key

The search feature uses the OpenAI API for generating embeddings and answers. To enable it:

  1. Log in to the Contensive Control Panel as an administrator or developer.
  2. Navigate to Settings and locate Site Properties.
  3. Add or edit the property named OpenAI API Key.
  4. Paste your OpenAI API key as the value and save.

The key is used for two OpenAI services:

  • text-embedding-3-small — converts help text and search queries into vectors for semantic matching.
  • gpt-4o-mini — generates the natural language answer from the top matching content.

If the API key is missing or invalid, search falls back to basic keyword matching automatically.

Building the Search Index

Help content must be indexed before AI search will return results. Indexing reads all markdown help files, splits them into chunks by heading, generates an embedding vector for each chunk, and stores them in the site database.

Indexing happens automatically when the Help Pages collection is installed or updated. You can also manually trigger a re-index:

  1. Navigate to /help on your site.
  2. Scroll down to the Re-index Help button in the admin tools section on the left.
  3. Click the button and wait for the confirmation message.

Re-indexing performs a full rebuild. It deletes all existing index data and re-processes every help file. This ensures the index is always in sync with the current help content.

When to Re-Index

You should re-index help content when:

  • You upload a new help article using the Add Article tool.
  • You delete a help article.
  • You install or update an addon collection that includes help files.
  • You add or modify files in the fieldhelp folder.

Collection installs trigger re-indexing automatically, but manual uploads and deletes do not. After uploading or deleting articles, click the Re-index Help button to update the search index.

Database Table

The search index is stored in a SQL Server table named help_search_index. This table is created automatically the first time indexing runs. It does not need to be created manually. The table stores the file path, role, heading, chunk text, embedding vector, and timestamps for each indexed chunk.

Cost Considerations

Each indexing run and each search query makes API calls to OpenAI. For a typical site with a few hundred help files, the cost is minimal (fractions of a cent per search, a few cents per full re-index). The embedding model (text-embedding-3-small) and answer model (gpt-4o-mini) are among the most cost-effective OpenAI models available.