Problem / Motivation

Currently, AI Content Chat only supports indexing node content types. Many Drupal sites store important content across multiple entity types beyond nodes:

  • Taxonomy terms – vocabularies with descriptions (e.g., glossaries, FAQs, product categories)
  • Block content (custom blocks) – reusable content blocks with important information (e.g., "About us", contact details, policies)
  • Media – media entities with descriptive metadata
  • Commerce products – product descriptions for e-commerce sites
  • Any custom entity type – contributed or custom modules that define their own content entities

By only supporting nodes, the chatbot misses a significant portion of the site's content, leading to incomplete or inaccurate answers.

Proposed resolution

Make the indexer fully entity-type agnostic:

  1. Settings form: Replace the hardcoded node bundle list with a dynamic list of all available content entity types and their bundles. The admin selects which entity types, bundles, and fields to index.
  2. ContentIndexer service: Replace all node-specific code (NodeInterface, getStorage('node'), getTitle()) with generic entity handling using ContentEntityInterface, EntityInterface::label(), and dynamic bundle key lookups.
  3. Entity hooks: Update hook_entity_insert, hook_entity_update, and hook_entity_delete to react to any configured content entity type, not just nodes.
  4. Config schema: Extend content_sources to include an entity_type key alongside bundle and fields.
  5. Database: No schema changes needed – the entity_type column already exists in the index table.
  6. Backward compatibility: An update hook migrates existing content_type config entries to the new entity_type + bundle format automatically.

Acceptance criteria

  • Admin can select any content entity type (node, taxonomy_term, block_content, media, etc.) on the settings form
  • Text fields for each bundle are dynamically discovered
  • Indexing, re-indexing, and automatic index updates work for all configured entity types
  • The chatbot uses content from all indexed entity types when answering questions
  • Existing node-only configurations continue to work after running drush updb
  • Internal/non-useful entity types (user, file, path_alias, etc.) are filtered from the settings form
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

  • main Comparechanges, plain diff MR !6

Comments

solimanharkas created an issue. See original summary.

solimanharkas’s picture

Assigned: solimanharkas » Unassigned
Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.