# Adding data to Vector Search Index

**URL:** <https://discuss.google.dev/t/adding-data-to-vector-search-index/146562>\
**Category:** Custom ML & MLOps\
**Tags:** agent-platform\
**Created:** [February 23, 2024, 7:30am UTC](https://discuss.google.dev/t/adding-data-to-vector-search-index/146562 "2024-02-23T07:30:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![someOne2](https://d3byx8b92xw3lq.cloudfront.net/user_avatar/discuss.google.dev/someone2/32/437_2.png) [@someOne2](https://discuss.google.dev/u/someOne2)\
**Post date:** [February 23, 2024, 7:30am UTC](https://discuss.google.dev/t/adding-data-to-vector-search-index/146562/1 "2024-02-23T07:30:03Z")

</div>

I am familiar with vectordbs like weaviate and pinecone, and trying to migrate my vectors to gcp. I have uploaded data to a bucket, created index with it and deployed an endpoint using python and following this documentation [Vector Search Quickstart](https://cloud.google.com/vertex-ai/docs/vector-search/quickstart).Querying works fine for the index.

Now I want to add new data to the same index, (batch upsertion or equivalent in weaviate or pinecone), which as far as i understand can be done via GUI by doing batch update in the edit Index option, but I am unable to figure out how can i achieve it with python client.

I apologise if this is stupid question, been trying to figure out for a while now, and docs are confusing me more than helping.

I looked at [update and rebuild Index](https://cloud.google.com/vertex-ai/docs/vector-search/update-rebuild-index#console) and [updateIndex](https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform_v1.services.index_service.IndexServiceClient#google_cloud_aiplatform_v1_services_index_service_IndexServiceClient_update_index), but am unable to figure out if this creates entire index from scratch with the new data or upserts them like weaviate or pinecone.

ps: UseCase:  
I want to be able to query my embeddings with text like, ‘a dog’ etc returning best matches.

---

<div class="post-metadata">

**Author:** ![lsolatorio](https://d3byx8b92xw3lq.cloudfront.net/user_avatar/discuss.google.dev/lsolatorio/32/212_2.png) [@lsolatorio](https://discuss.google.dev/u/lsolatorio)\
**Post date:** [March 1, 2024, 10:13pm UTC](https://discuss.google.dev/t/adding-data-to-vector-search-index/146562/2 "2024-03-01T22:13:09Z")

</div>

Hi @someOne2 ,

Welcome and thank you for reaching out to our community.

I believe both functionalities do not have batch data processing (upserting).

- The update index updates the metadata associated with the index, like description, labels, or settings while the actual data content (vectors and document IDs) remains untouched
- The rebuild index rebuilds the entire index from scratch, deleting all existing data in the index then recreates it using the data provided in the request

I hope I was able to provide you with useful insights.

---

<div class="post-metadata">

**Author:** ![someOne2](https://d3byx8b92xw3lq.cloudfront.net/user_avatar/discuss.google.dev/someone2/32/437_2.png) [@someOne2](https://discuss.google.dev/u/someOne2)\
**Post date:** [March 4, 2024, 4:55am UTC](https://discuss.google.dev/t/adding-data-to-vector-search-index/146562/3 "2024-03-04T04:55:16Z")

</div>

hey @lsolatorio , thanks for replying.

Is there an equivalent of upserting ( preferably batch upserts, like in pinecone & weaviate ), in google aiplatform ?  
Use Case : we have multiple collections with millions of records/vectors in each collection, which we frequently need to add-to, update to or delete from in bulk.

---

<div class="post-metadata">

**Author:** ![esthereklund](https://d3byx8b92xw3lq.cloudfront.net/user_avatar/discuss.google.dev/esthereklund/32/34912_2.png) [@esthereklund](https://discuss.google.dev/u/esthereklund)\
**Post date:** [March 7, 2024, 8:31pm UTC](https://discuss.google.dev/t/adding-data-to-vector-search-index/146562/4 "2024-03-07T20:31:58Z")

</div>

Hi @lsolatorio I guess somehow you’ve missed the option for batch update, which does upsert exactly the vectors.

---

<div class="post-metadata">

**Author:** ![esthereklund](https://d3byx8b92xw3lq.cloudfront.net/user_avatar/discuss.google.dev/esthereklund/32/34912_2.png) [@esthereklund](https://discuss.google.dev/u/esthereklund)\
**Post date:** [March 7, 2024, 8:43pm UTC](https://discuss.google.dev/t/adding-data-to-vector-search-index/146562/5 "2024-03-07T20:43:03Z")

</div>

Hey @someOne2 , not sure about the naming for Python but in .NET there is a class [IndexServiceClient](https://cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1/latest/Google.Cloud.AIPlatform.V1.IndexServiceClient#Google_Cloud_AIPlatform_V1_IndexServiceClient_UpsertDatapoints_Google_Cloud_AIPlatform_V1_UpsertDatapointsRequest_Google_Api_Gax_Grpc_CallSettings_) that has all methods to manage the index. And it has a method [UpsertDatapoints](https://cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1/latest/Google.Cloud.AIPlatform.V1.IndexServiceClient#Google_Cloud_AIPlatform_V1_IndexServiceClient_UpsertDatapoints_Google_Cloud_AIPlatform_V1_UpsertDatapointsRequest_Google_Api_Gax_Grpc_CallSettings_) that processes a [UpsertDatapointsRequest](https://cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1/latest/Google.Cloud.AIPlatform.V1.UpsertDatapointsRequest) which represents batch of vectors.

---

<div class="post-metadata">

**Author:** ![someOne2](https://d3byx8b92xw3lq.cloudfront.net/user_avatar/discuss.google.dev/someone2/32/437_2.png) [@someOne2](https://discuss.google.dev/u/someOne2)\
**Post date:** [March 17, 2024, 2:31pm UTC](https://discuss.google.dev/t/adding-data-to-vector-search-index/146562/6 "2024-03-17T14:31:10Z")

</div>

Hey @esthereklund , can you elaborate a bit on what do you mean by batch update here, and thanks for the above answer.
