Autocomplete enables you to make a more meaningful search by recognizing entities inside your input and offering them as query terms. Autocomplete will fill in the rest with 3 different types of results: brands, categories, and plaintext. The autocomplete complements the ‘typeahead’ parameter in a fuzzy search by providing related categories and brands that the user might be looking for. Suggestions could appear after typing the 1st character, however we recommend using it at least after the 3rd character to improve the user experience.
Sample use case 1: You would like to buy some wine, but you do not know where the closest wine shop is. Thanks to 'Categories' suggestions you would be able to find the POIs of an appropriate category. You type 'win' in your app, and at the 3rd character the service provides some suggestions like 'wine shop' or 'winery'.
Sample use case 2: You use an app to efficiently search for a POI of a specific brand, e.g., you want to find a TomTom office. Search Autocomplete will return suggested branded POIs based on only a few characters that you type in. So, when typing 'Tom' you can expect 'TomTom' as the suggested brand which will make your search result more meaningful.
The Autocomplete endpoint information is available in the Search API.
Have a look at the detailed documentation for more information related to the Autocomplete endpoint.
Use the following code snippets to try this in your app:
AutocompleteSearchQuery autocompleteQuery = AutocompleteSearchQueryBuilder.create(query, "en-GB") .withRadius(10_000) .withPosition(Locations.AMSTERDAM_LOCATION) .withCountry("NL") .withLimit(10) .build(); searchAPI.autocompleteSearch(autocompleteQuery);
val autocompleteQuery = AutocompleteSearchQueryBuilder.create(query, "en-GB") .withRadius(10_000) .withPosition(Locations.AMSTERDAM) .withCountry("NL") .withLimit(10) .build() searchApi.autocompleteSearch(autocompleteQuery)
Screenshots presenting how the autocomplete functionality works:
Results on the map