Fans out to autocomplete and search in parallel and blends them into one ranked list, so "pizz" gets the Pizzeria category and the pizzerias down the road together. A complete query works as well as a partial one.
filters.kinds to one side of SearchSuggestionKind
skips the other. No debouncing or caching, which belong in the caller's input loop.filters.boundingBox restricts and origin measures distance. V2 takes one
geographic input per request, so inside a box origin does not rank the places.signal, so aborting drops the pair.const { suggestions } = await getSearchSuggestions({ query: 'pizz' });
for (const suggestion of suggestions) {
if (suggestion.kind === 'category' || suggestion.kind === 'brand') {
// A refinement: run the follow-up it describes.
const narrowed = await suggestion.refine();
} else {
const place = await suggestion.resolve();
map.flyTo({ center: place.geometry.coordinates });
}
}
One query surface over places, brands and categories.