I would like to know if there is any support for geo-distance queries of products, such as those in elastic search (where you specify a latitude and longitude, followed by a range / radius).
I did read the documentation on ‘updating local inventory for vertexai search for commerce’ which describes the use of a place_id on the local_inventories object, but it is not clear on how this place_id works, and if it is related to the Places API.
Hello @C_H_I_L_L_E_D ! That is a great question. Transitioning from Elasticsearch’s geo_distance to Vertex AI Search for Commerce does require a slight shift in how we handle location data.
Regarding your question on place_id: Yes, it is designed to work in tandem with the Google Places API. The place_id on the local_inventories object acts as the unique identifier for a physical location (store, warehouse, or branch).
To achieve the ‘Geo-Distance’ functionality you are looking for, here is the typical workflow in Vertex AI Search:
Location Mapping: You don’t perform a raw lat/long radius query directly in the search request like in ES. Instead, you filter based on the place_id or location_id that has been pre-indexed in your local inventory.
Contextual Search: When a user searches for a product, you typically detect their location on the frontend (using Places API or Geolocation), then pass the corresponding place_id or a filter string to the Vertex AI Search API to show availability in that specific ‘place’.
Fulfillment Spec: Check the fulfillment_spec in the API. While it’s not a ‘radius’ search in the mathematical sense (e.g., find all within 5km), it focuses on Store Availability.
If you strictly need ‘Radius Search’ (spatial queries), you might need to combine Vertex AI Search with BigQuery GEOGRAPHY functions or Firestore’s Geohashes as a pre-filtering layer before calling the commerce engine, depending on how dynamic your ‘points’ are.