Named argument spread into `querySearch()` includes keys it does not accept, causing PHP fatal
## Problem `doSearch()` assigns `vector_input` and `query` into `$params` before the `if/else` branch: ```php $params['vector_input'] = $vector_input; $params['query'] = $query; if (!empty($vector_input)) { $response = $vdb_client->vectorSearch(...$params); } else { $response = $vdb_client->querySearch(...$params); // $params still has vector_input and query } ``` `querySearch()` does not accept `vector_input` or `query` as parameters. Spreading `$params` into it causes a PHP fatal: ``` PHP Fatal error: Unknown named argument $vector_input ``` ## Steps to reproduce 1. Install `ai_search`. 2. Configure a Search API index with the AI Search backend. 3. Submit a browse or filter-only query with no search keywords (for example, a Views block that lists all indexed content with no text input). 4. Observe: PHP fatal about an unknown named argument. ## Proposed resolution Move the `vector_input` and `query` assignments inside the `vectorSearch()` branch so `$params` is clean when `querySearch()` runs: ```php if (!empty($vector_input) || $has_keys) { $params['vector_input'] = $vector_input; $params['query'] = $query; $response = $vdb_client->vectorSearch(...$params); } else { $response = $vdb_client->querySearch(...$params); } ``` Note: the `$has_keys` variable is introduced by the fix in the related issue (issue https://git.drupalcode.org/project/ai_search/-/work_items/3584027, `vectorSearch()` never called for embedding-free providers). The two fixes should be applied together. ## Notes This affects all providers, not just embedding-free ones. Any site running a browse or filter-only query with no search keywords against an AI Search index will hit this fatal, regardless of which VDB provider is configured. Found while building [ai_pageindex](https://www.drupal.org/project/ai_pageindex), a VDB provider that uses LLM reasoning instead of embeddings. I did a quick search of the issue queue and did not find an identical report. If this is a duplicate, please share the link and close this one.
issue