# Vertex AI Vector Search: index_id is only valid for api_version='v1', v2 uses collections (llamaindex_v2_migration)

## TL;DR

[LlamaIndex Vector Search v2 migration guide]: dont mix v1 and v2 params. index_id with api_version='v2' fails with 'index_id is only valid for api_version='v1''. v2 uses collections instead of index plus endpoint, and v2 ops need the google-cloud-vectorsearch package (pip install the [v2] extra).

Use this when you run into the situation in the title.

**When not to use this skill:** unrelated tasks. It covers only the procedure above.

## Compatibility

The steps above apply to the commands named in them. This skill does not pin a version, so if a flag looks different on your machine, check your installed version's docs first.

## Details

If you want old behavior back, set VERTEX_AI_ENABLE_V2 to false.

Context: LlamaIndex Vector Search v2 migration guide: v1 and v2 parameters cannot be mixed. Passing index_id with api_version='v2' fails with index_id is only valid for api_version='v1'. v2 uses collections, not index plus endpoint, and v2 operations need the google-cloud-vectorsearch package installed. To force the old behavior, set the VERTEX_AI_ENABLE_V2 environment variable to false. v1 clear() is not supported; v2 supports it.
