Indexing breaks with custom SearchAPI DataSource
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3575992. --> Reported by: [mxr576](https://www.drupal.org/user/315522) Related to !1321 !1248 >>> <p>[Tracker]<br> <strong>Update Summary: </strong>[One-line status update for stakeholders]<br> <strong>Check-in Date: </strong>MM/DD/YYYY<br> <strong>Blocked by: </strong>[#XXXXXX] (New issues on new lines)<br> <strong>Additional Collaborators: </strong> @username1, @username2<br> <em>Metadata is used by the <a href="https://www.drupalstarforge.ai/" title="AI Tracker">AI Tracker.</a> Docs and additional fields <a href="https://www.drupalstarforge.ai/ai-dashboard/docs" title="AI Issue Tracker Documentation">here</a>.</em><br> [/Tracker]</p> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>We have a homegrown Search API that indexes things :tm: but they are not content entities and the data source does not extend <code>\Drupal\search_api\Plugin\search_api\datasource\ContentEntity</code>. </p> <p>When we try to index data from that data source the following error is triggered:</p> <pre>Drupal\Component\Plugin\Exception\PluginNotFoundException: The "xyz" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager-&gt;getDefinition() (line 139 of /var/www/html/web/core/lib/Drupal/Core/Entity/EntityTypeManager.php).<br><br>#0 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityFieldManager.php(230): Drupal\Core\Entity\EntityTypeManager-&gt;getDefinition()<br>#1 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityFieldManager.php(204): Drupal\Core\Entity\EntityFieldManager-&gt;buildBaseFieldDefinitions()<br>#2 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityFieldManager.php(471): Drupal\Core\Entity\EntityFieldManager-&gt;getBaseFieldDefinitions()<br>#3 /var/www/html/web/modules/contrib/ai/src/Base/AiVdbProviderClientBase.php(434): Drupal\Core\Entity\EntityFieldManager-&gt;getFieldStorageDefinitions()<br>#4 /var/www/html/web/modules/contrib/ai_provider_amazeeio/src/Vdb/Postgres/Plugin/VdbProvider/PostgresProvider.php(542): </pre><h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Removed hardcoded expectation from the code that only content entities can be indexed.</p> <h3 id="summary-remaining-tasks">Target date or deadline</h3> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ai-usage">AI usage (if applicable)</h3> <p>[ ] AI Assisted Issue<br> This issue was generated with AI assistance, but was reviewed and refined by the creator.</p> <p>[ ] AI Assisted Code<br> This code was mainly generated by a human, with AI autocompleting or parts AI generated, but under full human supervision.</p> <p>[ ] AI Generated Code<br> This code was mainly generated by an AI with human guidance, and reviewed, tested, and refined by a human.</p> <p>[ ] Vibe Coded<br> This code was generated by an AI and has only been functionally tested.</p>
issue