Places...LIMIT results to only include those that have street included

Currently implementing Places using algolia’s DB records, not my own private data set. I have the type set as ‘address’, countries set as ‘us’, and using default aroundLatLng to use user IP address. Wanting to know if it’s possible to not include results that do not include a street address. For example. if I search ‘1533’, all my top results are simply towns in Pennsylvania (assuming it matches that zip/postal code).

First, can I only return results that include street address? I have a feeling the answer is No, because Algolia owns the data and has set what is and isn’t searchable.

Second, I’m in Nashville, TN so have others found issues with reliability of IP fencing to help search? Or, know of a more effective way to use Places?

Hi @zach1

As you said, if you want to filter results to return only addresses and not the other types, you can specify that in the options setting the parameter like so: type: "address".

I just tested it, and indeed, it only returns streets that matches 1533 in their street name (usually road name). So I’m not sure of the issue you are facing.

To dig further, can you give me a full query example and the response you got?

Concerning the bias via IP, we don’t have any complaint about it. From all of our tests, this is working great. That said, we had a global issue with geo-IP last month for a few hours, which badly located some IPs.
The geo-IP database is updated regularly and is pretty precise. It is possible that a few IPs are wrongly located but as I said earlier, we don’t have open issues about it.

We highly recommend to let the default behavior of aroundLatLngViaIP set to true, as the relevancy of search for your users a improved. If you experience some issues with, please share more information to us so we can investigate it. In the meantime, you could set it to false.

Let me know if that helps!

Thanks Raphael.
I’m already specifying type:address in my options and using default LatLng settings, as you can see here:

(function() {
  var placesAutocomplete = places({
    container: document.querySelector('#address-autocomplete'),
    type: 'address',
    countries: 'us',
    style: false,
    templates: {
      value: function(suggestion) {
        console.log(suggestion);
        var strings = suggestion.name + ", " + suggestion.city + ", " + suggestion.administrative
        return strings;
      }
    }
  });
  placesAutocomplete.on('change', function resultSelected(e) {
    document.querySelector('#street_number').value = e.suggestion.name || '';
    document.querySelector('#form-address2').value = e.suggestion.administrative || '';
    document.querySelector('#form-city').value = e.suggestion.city || '';
    document.querySelector('#form-zip').value = e.suggestion.postcode || '';
    validateAddress(e.suggestion.name);
  });
})();
</script>

Let me try and clarify on the search/return issue…So when I start search 1533, you can see in the attached screenshot, the responses are all cities. No actual addresses included until you type a letter or something. Also, in second screenshot when searching 1312, I am literally at an address of 1312 in Nashville, TN and that is not even included in options returned so it clearly isn’t very effective in using IP fencing.

09 AM

00 AM

Another side question, is there a way to specify response to include the abbreviated state? For example, Arizona would return AZ.

Hope this helps…Thanks::Zach

So no feedback?..