Problem/Motivation

Currently, content indexing only happens when an admin manually clicks the "Re-index Content" button on the settings page. This means:
New content is not available in the chatbot until someone manually re-indexes
Updated content shows stale information in chatbot responses
Deleted or unpublished content may still appear in chatbot answers
Site editors have no way of knowing the index is outdated

Proposed resolution

Use Drupal entity hooks (hook_entity_insert, hook_entity_update, hook_entity_delete) to automatically update the index when content changes:
Node created: If it belongs to a configured content type and is published, index it immediately
Node updated: Update its index entry with the latest content. If unpublished, remove from index
Node deleted: Remove from index
The manual "Re-index Content" button remains available for full re-indexing when needed (e.g., after changing which content types or fields are configured).

Remaining tasks

Test with bulk content operations (e.g., bulk publish/unpublish)
Consider using Queue API for large batch operations to avoid timeout issues

Issue fork 3569915-3573386

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 !2

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.