VDB: Unable to index multi-valued fields
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3579505. -->
Reported by: [mxr576](https://www.drupal.org/user/315522)
Related to !54
>>>
<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>Indexing multivalue fields from content entities (plain text for sure, but probably other field types are also impacted) are failing at the SQL query level. For example:</p>
<pre>Warning: pg_query(): Query failed: ERROR: column "a" does not exist LINE 1: ..._multivalue_text_field" (value, chunk_id) values (a, currval... ^ in Drupal\ai_provider_amazeeio\Vdb\Postgres\PostgresPgvectorClient->insertIntoCollection() (line 208 of /var/www/html/web/modules/contrib/ai_provider_amazeeio/src/Vdb/Postgres/PostgresPgvectorClient.php) </pre><p>or on <a href="https://new.drupal.org/ai/demos">the Drupal AI demo</a> site (with the Uname demo site) after "Ingredients" added to the search index as "Filterable" at <code>admin/config/search/search-api/index/umami_recipe_index/fields</code>:</p>
<pre>Warning: pg_query_params(): Query failed: ERROR: column "field_ingredients" of relation "recipe_server" does not exist LINE 1: ..., drupal_long_id, server_id, index_id, embedding, field_ingr... ^ in Drupal\ai_provider_amazeeio\Vdb\Postgres\PostgresPgvectorClient->insertIntoCollection() (line 198 of /app/web/modules/contrib/ai_provider_amazeeio/src/Vdb/Postgres/PostgresPgvectorClient.php)<br><br>#0 /app/web/core/includes/bootstrap.inc(108): _drupal_error_handler_real()<br>#1 [internal function]: _drupal_error_handler()<br>#2 /app/web/modules/contrib/ai_provider_amazeeio/src/Vdb/Postgres/PostgresPgvectorClient.php(198): pg_query_params()<br>#3 /app/web/modules/contrib/ai_provider_amazeeio/src/Vdb/Postgres/Plugin/VdbProvider/PostgresProvider.php(231): </pre><h3 id="summary-proposed-resolution">Proposed resolution</h3>
<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