Skip to content

Commit e4e2a88

Browse files
authored
Merge pull request #1666 from noma4i/master
Add Language support for AWS Locations service
2 parents 19f3cd1 + 02bba5b commit e4e2a88

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/geocoder/lookups/amazon_location_service.rb

+6-3
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,17 @@ def results(query)
1111
params.merge!(index_name: configuration[:index_name])
1212

1313
# Aws::ParamValidator raises ArgumentError on unexpected keys
14-
params.delete(:lookup)
15-
14+
params.delete(:lookup)
15+
16+
# Inherit language from configuration
17+
params.merge!(language: configuration[:language])
18+
1619
resp = if query.reverse_geocode?
1720
client.search_place_index_for_position(params.merge(position: query.coordinates.reverse))
1821
else
1922
client.search_place_index_for_text(params.merge(text: query.text))
2023
end
21-
24+
2225
resp.results
2326
end
2427

0 commit comments

Comments
 (0)