Drupal is a registered trademark of Dries Buytaert
Release: Leaflet 10.4.11 Minor update available for module leaflet (10.4.11). Release: Session Inspector 1.0.8 Minor update available for module session_inspector (1.0.8). Release: Migrate QA 2.0.4 Minor update available for module migrate_qa (2.0.4). Release: CKEditor Description List 3.0.0 Major update available for module ckeditor_descriptionlist (3.0.0). Release: FlowDrop 2.4.0 Minor update available for module flowdrop (2.4.0). Release: JWT Token Refresh 1.0.4 Minor update available for module jwt_token_refresh (1.0.4). Release: ConReg 1.0.0-beta1 First beta version released for module conreg (1.0.0-beta1). Release: AI Image Studio 1.0.0-beta8 New beta version released for module ai_image_studio (1.0.0-beta8). Usage Milestone: Role Theme Switcher Module role_theme_switcher crossed 1,000 active installs. Module Revived: Decoupled Router 2.0.7 Module decoupled_router updated after 11 months of inactivity (2.0.7).

This module enhances Search API search results by adding AI-generated synonyms and search intent phrases. It processes content in the background, stores the AI-generated text in a local cache, and then injects it into your search index without needing a vector database. This allows for more intelligent semantic search directly from your standard relational database.

The AI Semantic Expansion module enriches your Search API indexes with AI-generated synonyms and search intent phrases, enabling semantic search on standard relational databases (MySQL, MariaDB, PostgreSQL) — no vector database required.

When a node is saved, the module queues it for processing. A background queue worker sends the node's content to your configured LLM provider (via the Drupal AI module) and stores the generated synonym text in a local cache table. During Search API indexing, the processor injects that cached text into a virtual field (ai_semantic_synonyms), which can be mapped and boosted like any other fulltext field.

Key features

  • Zero live HTTP calls during indexing. All AI generation happens in the background queue worker; the Search API processor only reads from the local cache.
  • Hash-based deduplication. The cache row is only regenerated when the source content actually changes, preventing redundant API calls.
  • Provider-agnostic. Works with any chat-capable provider configured in the Drupal AI module (OpenAI, Anthropic, Ollama, and others).
  • Configurable per index. Source fields, character limit, system prompt, and AI provider are all set on the Search API processor configuration form.
  • Bulk pre-warm command. Run drush ai-expand:batch to pre-populate the cache for all existing nodes before the first indexing run.
  • Cache management. A “Flush AI cache” button on the processor form lets administrators clear and regenerate all entries. Changing the LLM prompt automatically invalidates the cache and notifies administrators to re-run the batch command.

Requirements

  • Drupal 10.4 or 11
  • Drupal AI module with at least one chat-capable provider configured
  • Search API module with an active index

Installation

  1. Enable the module: drush en ai_semantic_expansion
  2. Run database updates: drush updb
  3. Go to your Search API index → Processors and enable AI Semantic Expansion.
  4. Go to Fields and add the AI Semantic Synonyms virtual field; set its type to Fulltext and apply a boost weight.
  5. Pre-warm the cache for existing content: drush ai-expand:batch
  6. Re-index: drush search-api-index

Activity

Tracked releases
4
Tracked since
May 2026
Latest release
3 months ago
Releases (12 mo)
4 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Release date
1.0.0-alpha3 Pre-release May 19, 2026
1.0.0-alpha2 Pre-release May 19, 2026
1.x-dev Dev May 19, 2026
1.0.0-alpha1 Pre-release May 19, 2026