AI search indexing expects entities to be always bundles

Created on 10 April 2025, 15 days ago

Problem/Motivation

We have a bit unusual project with custom single-type entities.

Form building code for AI search field indexing always expects entity to have default bundle, even technically it's not required in Drupal (as far as we know). This makes it not possible to index these entities to VDB like Pinecone.

Steps to reproduce

Have a project with minimal single-type entity and try to add VDB/Pinecone index.

Fields- tab in Search API index prints out errors:

Warning: Undefined array key "bundles" in Drupal\ai_search\Form\AiSearchIndexFieldsForm->buildForm() (line 219 of modules/contrib/ai/modules/ai_search/src/Form/AiSearchIndexFieldsForm.php).

Warning: Trying to access array offset on null in Drupal\ai_search\Form\AiSearchIndexFieldsForm->buildForm() (line 219 of modules/contrib/ai/modules/ai_search/src/Form/AiSearchIndexFieldsForm.php).

Proposed resolution

Make Ai search fields work with non-bundle entities.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

AI Search

Created by

🇫🇮Finland sundflux

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024