Drupal module for integrating with QuantSearch.ai - AI-powered semantic search and chat widgets.
- OAuth Connection - Securely connect to QuantSearch.ai with one click
- Real-time Indexing - Automatically index content when nodes are created/updated
- Batch Indexing - Queue-based processing for bulk operations
- Search Widgets - Three widget types:
- Chat Widget - Floating AI chat button
- Modal Widget - Cmd+K style search modal
- Search Page - Full search results page
- Drush Commands - CLI tools for indexing and crawl management
- Drupal 10.x or 11.x
- PHP 8.1+
- Key module
- QuantSearch.ai Pro or Enterprise plan
composer require quantcdn/quantsearch_ai
drush en quantsearch_ai- Navigate to Configuration > Search and metadata > QuantSearch AI
- Click Connect to QuantSearch
- Log in to your QuantSearch.ai account
- Authorize the Drupal integration
- Select a site from your organization
- Go to the Indexing tab
- Select which content types to index
- Configure field mappings:
- Body Field - Main content field
- Summary Field - Short description field
- Tags Field - Taxonomy reference for tags
- Choose indexing mode:
- Real-time - Index immediately on node save
- Queue-based - Batch process via cron/drush
Enable the floating chat widget site-wide in the module settings.
Place widgets in specific regions using Drupal's block system:
- QuantSearch Chat Widget - Floating chat button
- QuantSearch Modal Widget - Cmd+K search overlay
- QuantSearch Search Page - Full search results
# Queue all content for indexing
drush quantsearch:index
drush qs-index
# Process the indexing queue
drush quantsearch:process-queue --limit=100
drush qs-process --limit=100
# Check queue status
drush quantsearch:queue-status
drush qs-queue
# Trigger a site crawl
drush quantsearch:crawl --max-pages=500
drush qs-crawl --max-pages=500
# Check crawl status
drush quantsearch:crawl-status <job_id>
drush qs-status <job_id>
# Purge the entire index
drush quantsearch:purge
drush qs-purgeThe module provides services that can be used programmatically:
// Get the QuantSearch client
$client = \Drupal::service('quantsearch_ai.client');
// Index pages directly
$client->ingestPages([
[
'url' => 'https://example.com/page',
'title' => 'Page Title',
'content' => '<p>HTML content</p>',
'contentType' => 'html',
],
]);
// Trigger a crawl
$job_id = $client->triggerCrawl(['maxPages' => 100]);
// Check crawl status
$status = $client->getCrawlStatus($job_id);/**
* Implements hook_quantsearch_ai_page_alter().
*/
function mymodule_quantsearch_ai_page_alter(array &$page, NodeInterface $node) {
// Add custom metadata
$page['tags'][] = 'custom-tag';
// Modify content
$page['content'] .= '<p>Additional content</p>';
}- Check that the content type is enabled for indexing
- Verify the node is published
- Check the queue status:
drush qs-queue - Process the queue:
drush qs-process
- Ensure you have a Pro or Enterprise plan on QuantSearch.ai
- Check that your site can reach
https://quantsearch.ai - Review Drupal logs for detailed error messages
- Verify the site ID is configured
- Check browser console for JavaScript errors
- Ensure CDN URL is accessible:
https://cdn.quantsearch.ai/v1/widget.js
GPL-2.0-or-later