Drupal module
A turnkey Drupal 10/11 module for QuantSearch. Connects via OAuth from your admin UI, indexes nodes in real time as they're saved, and exposes the chat, modal, and search-page widgets as standard Drupal blocks.
Source on GitHub: quantcdn/drupal-quantsearch-ai.
Requirements
- Drupal 10.x or 11.x
- PHP 8.1+
- The Key module (installed automatically as a dependency)
- A QuantSearch.ai account on the Pro or Enterprise plan
Install
Install with Composer and enable via Drush:
composer require quantcdn/quantsearch-ai
drush en quantsearch_ai That installs the module and its Key dependency.
Connect to QuantSearch
- Open Configuration › Search › QuantSearch AI
(
/admin/config/search/quantsearch). - Click Connect to QuantSearch. You'll be redirected through the OAuth flow.
- Pick the QuantSearch site to associate with this Drupal install.
- Choose which content types should be indexed.
Tokens are stored via the Key module. No API keys to copy or rotate manually.
Place widgets
The module exposes the chat, modal, and search-page widgets as Drupal blocks. Place them through Structure › Block Layout:
- QuantSearch chat widget — the floating chat button
- QuantSearch modal widget — the ⌘K search overlay
- QuantSearch search page — the dedicated search-results region
Block visibility, region, and weight all behave like any other Drupal block. No template overrides required.
Indexing
Real-time indexing is on by default. Node save, publish, and delete events are queued and posted to QuantSearch in the background.
For bulk operations, use the included Drush commands:
# Queue every published node of indexed types
drush qs-index
# Process the indexing queue (cron also picks this up)
drush qs-process
# Inspect queue size
drush qs-queue
# Trigger a full external crawl on the QuantSearch side
drush qs-crawl
# Wipe the index for this site
drush qs-purge The bulk indexing UI at /admin/config/search/quantsearch/indexing wraps
the same queue API if you'd rather use the dashboard.
Extending the payload
You can alter the page document before it's sent to QuantSearch by implementing
hook_quantsearch_ai_page_alter():
/**
* Implements hook_quantsearch_ai_page_alter().
*/
function mymodule_quantsearch_ai_page_alter(array &$page, \Drupal\node\NodeInterface $node) {
// Add custom tags from another field
$page['tags'][] = 'custom-tag';
// Append rendered content from a paragraphs reference, etc.
$page['content'] .= '<p>Additional content</p>';
} The $page array is the JSON payload that will be POSTed to the
Ingestion API. Modify it in place.
Local development
The repository ships with a docker-compose stack so you can poke at the module against a fresh Drupal install:
git clone https://github.com/quantcdn/drupal-quantsearch-ai
cd drupal-quantsearch-ai
docker-compose up -d
./scripts/install-drupal.sh That brings up Drupal at http://localhost:8090
with the module enabled. Login is admin / admin for local only.
Troubleshooting
PHP changes need a cache clear:
drush cr
If the queue stops processing, check that cron is running and that the
quantsearch_ai_indexing queue worker is enabled. The module logs to
Drupal's standard logger under the quantsearch_ai channel.
Next
- Customise the chat widget
- Configure the modal
- Ingestion API — what the module is calling under the hood