- Newest
- Most votes
- Most comments
You're correct that the Amazon Location Service v2 Places API's /suggest endpoint no longer supports filtering categories in the request. This is a change from the v0 API that you were previously using with the Esri place index.
In the v2 API, the Suggest operation does not have a direct equivalent to the FilterCategories parameter. However, there are a few alternatives you can consider:
-
Client-side filtering: As you mentioned, you can filter the results on the client side. This approach requires enabling the "Core" additional features, which does indeed increase the cost and data payload. It's not ideal, especially with the MaxResults limit, as you pointed out.
-
Use the SearchNearby or SearchPlaceIndex APIs: If your use case allows, you could consider using these APIs instead. They support filtering by categories in the request using the Filter parameter. For example, with SearchNearby, you can use the IncludeCategories filter to specify categories like schools and parks.
-
Two-step approach: You could use the Suggest API to get initial results, and then use those results to make a subsequent call to SearchPlaceIndex or GetPlace to retrieve more detailed information, including categories. This would allow you to filter at that stage.
-
Provide feedback to AWS: Since this is a significant change that affects your use case, it would be valuable to provide feedback to AWS about the need for category filtering in the Suggest API.
Regarding the v0 API, AWS typically maintains backwards compatibility for a considerable time. However, it's generally recommended to migrate to the latest version when possible. AWS hasn't announced any immediate plans to deprecate v0, but it's always a good idea to stay updated with the latest versions for long-term support and new features.
If the category filtering in Suggest is crucial for your application and the alternatives don't meet your needs, you might need to continue using the v0 API for now. However, you should plan for eventual migration and keep an eye on AWS announcements regarding the v0 API's lifecycle.
Sources
Filtering - Amazon Location Service
Suggest - Amazon Location Service
SearchPlaceIndexForSuggestions - Amazon Location Service
Relevant content
- asked 6 months ago
- asked 5 years ago
