Assigned
Status Update
Comments
mi...@google.com <mi...@google.com> #2
This is the intended behavior, the meaning of the documentation is different.
Each component filter can be used only once.
A request with multiple component filters would be one with components=country:es|postal_code:38005
All examples follow this and no example shows duplicate filters. The API behavior is to ignore multiple filters.
In contrast, Place Autocomplete documentation explicitly explains a limit of 5 country filters. At the same time, it does not explain that other filters, such as those supported by the Geocoding API, are unsupported and will be silently ignored.
https://developers.google.com/places/web-service/autocomplete#place_autocomplete_requests
Each component filter can be used only once.
A request with multiple component filters would be one with components=country:es|postal_code:38005
All examples follow this and no example shows duplicate filters. The API behavior is to ignore multiple filters.
In contrast, Place Autocomplete documentation explicitly explains a limit of 5 country filters. At the same time, it does not explain that other filters, such as those supported by the Geocoding API, are unsupported and will be silently ignored.
yo...@gmail.com <yo...@gmail.com> #3
I understand that, but the documentation states that if multiple (not duplicate) countries are specified, then an AND is used on the query. Thats clearly not happening.
Its also not ignoring multiple countries, if that's what it means, as the output changes if you so 'country:uk|country:ir'.
Its also not ignoring multiple countries, if that's what it means, as the output changes if you so 'country:uk|country:ir'.
mi...@google.com <mi...@google.com> #4
Thanks for the update. Indeed there is a mismatch between documentation and API behavior when multiple country filters are specified in the Geocoding API. We will look into fixing this.
[Deleted User] <[Deleted User]> #5
HI, when this fix will be done and how autocomplete work with multi countries based search?
[Deleted User] <[Deleted User]> #6
Can you please let me know what are you considering to fix? API Docs or API logic ?
mi...@google.com <mi...@google.com> #7
We are looking into fixing this, but not as high priority.
Specifying multiple country restricts in the Geocoding API is an invalid request, the fix will be returning ZERO_RESULTS as per API documentation.
Place Autocomplete does support multiple (up to 5) country restricts.
Please see how to add multiple county restricts here:
https://developers.google.com/places/web-service/autocomplete#place_autocomplete_requests
https://developers.google.com/maps/documentation/javascript/places-autocomplete#add_autocomplete
See also this new example: Place Autocomplete Restricted to Multiple Countries
https://google-developers.appspot.com/maps/documentation/javascript/examples/places-autocomplete-multiple-countries
Specifying multiple country restricts in the Geocoding API is an invalid request, the fix will be returning ZERO_RESULTS as per API documentation.
Place Autocomplete does support multiple (up to 5) country restricts.
Please see how to add multiple county restricts here:
See also this new example: Place Autocomplete Restricted to Multiple Countries
mi...@google.com <mi...@google.com> #8
We have an update of this.
Starting soon (this or next week), the Geocoding API will return INVALID_REQUEST (not ZERO_RESULTS) if there are 2 or more country: or postal_code: filters.
Examples:
https://maps.googleapis.com/maps/api/geocode/json?address=Travelodge+Torrelaguna&components=country:uk|country:es
https://maps.googleapis.com/maps/api/geocode/json?address=Travelodge+Torrelaguna&components=postal_code:28027|postal_code:28028
ZERO_RESULTS will be returned when the request is valid in terms of the number of filters, but the filters are mutually exclusive.
Examples:
https://maps.googleapis.com/maps/api/geocode/json?address=Travelodge+Torrelaguna&components=country:es|postal_code:HA5+1AG
https://maps.googleapis.com/maps/api/geocode/json?address=Travelodge+Torrelaguna&components=country:uk|postal_code:28027
Starting soon (this or next week), the Geocoding API will return INVALID_REQUEST (not ZERO_RESULTS) if there are 2 or more country: or postal_code: filters.
Examples:
ZERO_RESULTS will be returned when the request is valid in terms of the number of filters, but the filters are mutually exclusive.
Examples:
al...@webtomed.com <al...@webtomed.com> #9
Regarding this issue, as well as https://issuetracker.google.com/issues/123377220 , is there any intention to provide support for multiple countries in Geocoder as it exists in Places Autocomplete, without having to go through Autocomplete first?
mi...@google.com <mi...@google.com> #10
We have an update on this.
Geocoding requests with multiple country component filters are invalid. There are no plans to implement the feature request inhttps://issuetracker.google.com/issues/123377220 , which means such request will remain invalid for the foreseeable future.
Unfortunately, there are client applications that send significant amounts of such invalid requests. For these applications, the intended change would return INVALID_REQUEST for a significant potion of those applications' requests. We are looking into notifying the owners of such applications in advance of making this change and will keep this issue updated.
Geocoding requests with multiple country component filters are invalid. There are no plans to implement the feature request in
Unfortunately, there are client applications that send significant amounts of such invalid requests. For these applications, the intended change would return INVALID_REQUEST for a significant potion of those applications' requests. We are looking into notifying the owners of such applications in advance of making this change and will keep this issue updated.
Description
# It is OK to share your API Project ID, but _not_ API keys.
Issue report
----------------
query:
Expected behaviour:
as the component filter contains multiple countries and the documentation (
Actual behaviour:
However, it returns the expected result (for country:es), plus some extra match data.
Running the query with just 'country:es' also returns the expected result of 1 entry.
Either the documentation is wrong, (has there been an update that changed this logic?) or the logic in the codebase is incorrect.
This is leading to a lack of confidence that we are actually querying the api properly.
Please can you confirm that the OR logic is correct and the docs are wrong? Or do we need to change our approach and expect a change in behaviour?