AI search indexing expects entities to be always bundles
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3518498. -->
Reported by: [sundflux](https://www.drupal.org/user/3795340)
Related to !568 !556
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>We have a bit unusual project with custom single-type entities. </p>
<p>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.</p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<p>Have a project with minimal single-type entity and try to add VDB/Pinecone index.</p>
<p>Fields- tab in Search API index prints out errors:</p>
<pre>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).<br><br>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).</pre><h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Make Ai search fields work with non-bundle entities.</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<h3 id="summary-ui-changes">User interface changes</h3>
<h3 id="summary-api-changes">API changes</h3>
<h3 id="summary-data-model-changes">Data model changes</h3>
issue