- Issue created by @aarnau
When attempting to index a Search API index using the "AI VDB Provider (PostgreSQL)" server, a Drupal\ai_vdb_provider_postgres\Exception\InsertIntoCollectionException
is thrown.
This error specifically occurs when a 'select string' type field (such as a text list field) is configured, and the "Filterable attributes" option is selected in the field's settings within the Search API index.
The generated INSERT
query does not enclose string values in single quotes, causing PostgreSQL to interpret them as column names instead of string literals. This leads to the "column does not exist" error.
search_api
, search_api_db
(or your chosen storage provider), and ai_vdb_provider_postgres
modules are installed and enabled./admin/config/search/search-api/index/[your_index]/fields
), expand the "Index options" section and ensure the "Filterable attributes" select is marked.drush search-api:index
).The content should be indexed successfully without SQL errors. The string values ('primavera', 'otono', 'invierno') should be correctly inserted into the table, enclosed in single quotes within the INSERT
query.
The indexing process fails with the following exception and error message:
Drupal\ai_vdb_provider_postgres\Exception\InsertIntoCollectionException: ERROR: column "primavera" does not exist LINE 1: ...NTO "pois__year_season" (value, chunk_id) values (primavera,... ^ in Drupal\ai_vdb_provider_postgres\PostgresPgvectorClient->insertIntoCollection() (line 213 of /var/www/html/web/modules/contrib/ai_vdb_provider_postgres/src/PostgresPgvectorClient.php).
The generated SQL query causing the error is:
INSERT INTO "pois__year_season" (value, chunk_id) values (primavera, currval('"pois_id_seq"')),(otono, currval('"pois_id_seq"')),(invierno, currval('"pois_id_seq"'));
As observed, the values primavera
, otono
, invierno
are not enclosed in single quotes, leading PostgreSQL to interpret them as non-existent column names.
Active
1.0
Code