Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Language support for AWS Locations service #1666

Merged
merged 2 commits into from
Nov 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions lib/geocoder/lookups/amazon_location_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ def results(query)
params.merge!(index_name: configuration[:index_name])

# Aws::ParamValidator raises ArgumentError on unexpected keys
params.delete(:lookup)

params.delete(:lookup)

# Inherit language from configuration
params.merge!(language: configuration[:language])

resp = if query.reverse_geocode?
client.search_place_index_for_position(params.merge(position: query.coordinates.reverse))
else
client.search_place_index_for_text(params.merge(text: query.text))
end

resp.results
end

Expand Down
Loading