Home › Toolset Professional Support › [Resolved] Toolset Maps distance search doesn't find result if address doesn't have postal
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | - |
- | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | - |
Supporter timezone: Asia/Kolkata (GMT+05:30)
This topic contains 12 replies, has 2 voices.
Last updated by Minesh 1 year, 11 months ago.
Assisted by: Minesh.
I am trying to:
Search for installers (Toolset CPT) near a location (Toolset Maps distance search)
Link to a page where the issue can be seen:
hidden link
Search in "Milford, NH" and for a partner named "6 gen"
I expected to see:
6 Gen Masonry, LLC in the search results
Instead, I got:
no results until I edited 6 Gen and added a postal code to the address. They do not have a physical location so their address was just Milford, NH, USA.
At first I thought it was just an issue of their address not being in the location cache or the user having not selected a Google suggested address but if I edit the record again use only "Milford, NH USA" picked from the Google suggested locations, it still fails. If I use "Milford, NH 03055 USA" it works properly.
Any idea why this would happen?
Hello. Thank you for contacting the Toolset support.
First of all, based on the debug information you shared I find that you are using the outdated Toolset Types plugin. We always recommend running your site with the latest stable release plugin version.
*** Please make a FULL BACKUP of your database and website.***
Could you please update ALL Toolset plugins to it's latest officially released version. You can download the latest plugin release from your accounts page:
=> https://toolset.com/account/downloads/
Once you done with that - regarding the original issue you reported about the maps address issue, I would like to check what co-ordinates are stored for address "Milford, NH, USA" and for "Milford, NH 03055 USA" (which is having the zip code) with the Toolset Maps address cache.
If you able to locate the address cache from: Toolset => Settings => Maps tab => Cached data section. Check for missing cache entry and can you please share the screenshot for both the address "Milford, NH, USA" and for "Milford, NH 03055 USA".
OR
You may want to share admin access details and also share the edit post link where you have updated the address.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
So I would like to inform you here when we search for address - we are directly using the google API.
It is not on us what result should be displayed with map address auto-complete its on google. You can see the following example and try to search for "Milford, NH" with the following URL and you will not find the address "6 Gen Masonry, LLC" with the auto-suggest search dropdown box.
- hidden link
I see you have added to display the posts within the 30 miles of radius so search will work accordingly.
- Show posts within 30mi radius of address/coordinates provided using toolset_maps_distance_center URL parameter.
That Google example page does not auto suggest any towns with All selected but if you change the option to Geocode is returns Milford, NH USA just fine. I thought Toolset was just geocoding addresses with the places API. If you don't select Geocode in the Google example page, you can't even get a major city like Boston, MA to appear in the autosuggest.
Actually - we just pass the address string to the Google map API so we don't have much control over this.
Logically - The more precise search text parameters we'll offer the more precise options the Google autocomplete options will be returned by google map API.
If you open google maps directly: hidden link and search for 'Milford, NH USA' - you will notice the same options.
Do you mean that even though you search with the text 'Milford, NH USA' - still the posts where the address set as 'Milford, NH USA' does not show in the search result?
If I type Milford NH or Milford NH, USA into the search box and in either case click the Google auto suggested 'Milford NH, USA' to use their suggestion, I do not find the 6 Gen Masonry post that was saved with Milford NH, USA (also from the Google auto suggest) as its address. If I save it with Milford NH 03055, USA as the address, I can find it with Milford NH, USA or Milford NH 03055, USA as the search term.
My client is very worried that this isn't just some issue that is unique to Milford NH and that other installers may not be findable in their installer search. It isn't easy to test them all.
What I noticed was that if I saved the installer post with Milford NH, USA as the address, picked from Google's auto suggest, nothing goes into the cache but if I save the installer post with Milford NH 03055, USA as the address, it goes in the cache.
Based on the information you shared I run a test.
Here is the sandbox site and you can auto-login to it using the following link:
- hidden link
What I found that when I created post with address "Milford NH, USA" and save the post and checked the map address cache I can see the address is available with map address cache.
Here is the post I've created:
- hidden link
And as you can see the address is available with cache:
- hidden link
Can you please try to reproduce the issue on this sandbox site?
The issue was never the ability to show one record on a map, it is with the distance search on a map and list display of search results.
In your sandbox I created an Electrician Finder View and put it on a page. I then added all the addresses with "Milford" somewhere in them as electricians. I deleted your Eelectrician and cleaned that address from the Maps cache. I then created a new Test Case in NH electrician with Milford, NH USA as the address.
If you look at the finder and search for Milford, NH USA (the theme you used is making the search address field very narrow which isn't ideal), the Test Case in NH electrician is not in the results. This is the same problem we're seeing on the live site.
hidden link
I ran the "Check for missing cache entries" for Maps, just in case my removing Milford, NH USA and the Electrician record you created and then adding a new Test Case in NH electrician with Milford, NH USA as the address caused a cache problem. It said it found a missing cache entry and processed it but that did not help the Test Case in NH result show on my finder. I also disabled caching on the View block's settings for the finder. Same results.
I also modified the Electrician Content Template to show the current electrician on a map. This works fine for the Test Case in NH and other electricians as expected. The issue is with distance search.
Can you please check now:
=> hidden link
Here are the steps I've followed:
- I navigate to Toolset => Settings => Maps tab and then I click on the "Load stored data" button to see the list of all cached addresses and map coordinates and then deleted them all from there.
- After that, I used the "Check for missing cache entries" option again it generated the cache of all those addresses again
- the missing post is now correctly displayed in the search.
It seems that earlier due to adding similar addresses with close proximity lat/long addresses, one of the address was not properly cached in the database.
Can you please try to use the same steps on the live website too and it should start showing the missing results in the search.
This is easy to do in the sandbox with a handful of addresses. On our live site, there are hundreds of partners and past experience tells me that many will not properly come up in the search results until the cache is completely rebuilt either by waiting for it to happen 15 records at a time or saving each partner to force its address back into the cache. Neither is inexpensive in time or money for my client.
Besides the time to rebuild the cache, there is no button to clear the entire map cache so I will have to click the little red x one at a time for over 5,550 addresses which will take a very long time. Is there some other way to safely clear the address cache? Can I just empty the entire wp_toolset_address_maps_cache table directly in the database?
Or are you saying I can just delete the records near Milford, NH? And how do I know a similar problem isn't happening in another geographic area without trying every single address on the search?
Besides the time to rebuild the cache, there is no button to clear the entire map cache so I will have to click the little red x one at a time for over 5,550 addresses which will take a very long time. Is there some other way to safely clear the address cache? Can I just empty the entire wp_toolset_address_maps_cache table directly in the database?
==>
Yes - that could be the possibility but I suggest before you do any interaction with database please take full backup of your site so in any worst case you will have a backup and you can restore it.
Or are you saying I can just delete the records near Milford, NH?
==>
That would be also good idea, first try to just remove records near Milford, NH and then try to click on the button "Check for missing cache entry" on Toolset => Settings => Maps tab. If this works then you do not have to delete or empty whole database table "wp_toolset_address_maps_cache ".
And how do I know a similar problem isn't happening in another geographic area without trying every single address on the search?
==>
This is a workaround for now and it this really happens with other addresses then our Devs will have to have a closer look on this and then I'll escalate this issue in front of them.
Cleaning out the entire address cache table and rebuilding it does seem to fix the issue but I have no way to no whether it will come back next time we add an additional partner record in the same town as another so I'd appreciate it if this can still be escalated to the developers. It can be at a lower priority since our issue is at least temporarily resolved but it would be good if they can find the root cause of the problem and make sure it doesn't happen again.
The scenario in my 22 December reply above on your sandbox site is one they can use to investigate further. They don't even need access to our site.
Currently due to Christmas holidays most of the Devs are on holiday. I'm taking a note here and will discuss with concern person when everyone is back from holidays and will update you here. Please hold on for further updates.
If you want you can close this ticket for now.