It calls 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. There is no debouncing or caching, which belong in your input loop.filters.boundingBox restricts results and geoBias.position measures distance. V2 takes one
geographic input per request, so inside a box geoBias 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.mapLibreMap.flyTo({ center: place.geometry.coordinates as [number, number] });
}
}
Suggests places, brands and categories for one query.