Skip Navigation

[Resolved] Map search shows no result for one specific city

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

This topic contains 18 replies, has 3 voices.

Last updated by Jim 1 year, 6 months ago.

Assisted by: Waqar.

Author
Posts
#2594301

Jim

Tell us what you are trying to do?
I have multiple entries in my system that have addresses in a particular city but the search shows no results when this city is set as the search location. If you search for a specific address in this city, all of the results for the city will show up, but not if you search just the city.

The city is Halifax, NS, Canada

If you search for the name 'connors' instead of location, you will see a result that is exactly in this city. There are also many others. None of them will show up if you search for that city by name.

The search page is hidden link
The search page specific to this search, using autocomplete to fill in city, province, country is:
hidden link

Is there any documentation that you are following?
There seems to be a similar issue reported here:
https://toolset.com/forums/topic/toolset-maps-distance-search-doesnt-find-result-if-address-doesnt-have-postal/

Other documentation:
https://toolset.com/course-lesson/data-caching-for-maps-addresses/?utm_source=toolsetmapsplugin&utm_campaign=toolsetmaps&utm_medium=views-integration-settings-for-cached-data&utm_term=our%20documentation

Is there a similar example that we can see?
Links provided above.

What is the link to your site?
hidden link

#2595135

Hi,

Thank you for contacting us and I'd be happy to assist.

When I search by name 'connors', I see one result 'Mike Connors' from the 'Halifax, NS, Canada'.

The search link that you shared for the location center 'Halifax, NS, Canada', doesn't show this 'Mike Connors' result, because the 'Results within' radius is set to 20 Km. If you increase that to a higher value like 50 Km, this result also starts showing.

So it is important to take into account the result's distance from the city center that is being used for the search. Only the results which fall within the specified radius of the city center will show.

I hope this helps and please let me know if you need further assistance.

regards,
Waqar

#2595481

Jim

Hi Waqar.

Thank you for your response. However, it does not address the issue I described.

I should not have to increase the search radius to 50km because this person is much, much closer than that. When you search for 'Halifax, NS, Canada' only one result is displayed. However, if you search for a specific address within the city of Halifax, many results are displayed. These results should all show up for a search of 'Halifax, NS, Canada'.

The only result that is displayed when you search for 'Halifax, NS, Canada' is a person who is not even in Halifax. They are in a nearby town called 'Porters Lake'. Porters Lake is actually 30km away from the center of Halifax, and should not show up for searches within 20km of Halifax. However, it shows up and the results that are actually IN Halifax, do not show up.

For now, ignore the search for 'connors'. Nobody results for the city of Halifax are displayed when you search within 20km of Halifax, yet there should be a large number of them.

Please try the following searches with nothing in the 'Search by Name' field.

Search: 'Halifax, NS, Canada'
Search: '2810 Windsor Street, Halifax, NS, Canada'

You will see the difference.

Jim

#2597407

Jim

Hi.

Any thoughts on this?

Your insight is greatly appreciated.

Jim

#2597605

Hi Jim,

Just wanted to let you know that I'm still working on this and will be able to share my findings within the next few hours.

Thank you for your patience.

regards,
Waqar

#2599021

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Jim

Sorry, Waqar was ill, I'm checking his queue and I see this ticket.

I don't have access to your site back end so I can't check, but it looks to me like the cached coordinates for Halifax are slightly off for some reason, so I suggest that you check the cache entry for Halifax and delete it (the cache entry will be regenerated).

For reference, when I enter Halifax, NS, Canada in your location field the autocomplete comes back with these coordinates for Halifax:

lat: 44.6475811, lng: -63.5727683

Go to Toolset > Settings > Maps and load the cache data, and check the entry for Halifax. Unless it is the same, delete it. (Also check for additional entries that are named similar but perhaps slightly different, and delete those, too.)

If there are a very great many entries in the cache and you are comfortable using toolset such as phpMyAdmin you could work directly on the wp_toolset_maps_address_cache table.

#2599203

Jim
Screenshot 2023-04-25 at 8.30.09 AM.png

Hi Nigel

Thank you very much for the response.

I checked the cached data for Halifax and the lat/long look correct. I'll attach a screenshot.

Any other ideas?

Jim

#2599651

Thank you for confirming that.

To troubleshoot this further, we'll need to see how this view's search is set up and also analyze the coordinates of the addresses that are stored in the database.

Can you please share the temporary admin login details of the website? We'll also need your permission to download the website's clone/snapshot, to investigate this on a different server.

Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.

#2600817

Thank you for sharing the admin access and the permission.

I've downloaded the website's clone and will be performing some testing on the local server. When database-level troubleshooting is involved, it is faster and more efficient to have the website on a local server.

Will share the findings as soon as this testing completes.

#2601765

Just wanted to let you know that I'm still working on this and will share the findings today.

#2602539

Jim

Hi Waqar.

Any luck yesterday?

#2602691

Yes, I've been doing some testing around this and it turned out to be more complex than I anticipated.

I'll get back to you with the details in the next few hours.

#2603393

Jim

Hi Waqar.

I didn't see a reply. Any luck?

Jim

#2603997

Hi Jim,

First, thank you for waiting as I worked on this tricky investigation case.

After testing on your website's clone as well as on a couple of clean test websites, here are the findings.

The correct lat/long coordinates for the location 'Halifax, NS, Canada' is '44.647581, -63.572768'. But only on your website's clone, the incorrect coordinates of '44.885709, -63.100527' are used for this location/address. This behavior is not reproducible on any of the test websites that I've used.

This screenshot shows how much off that incorrect map location is, from the rest of the 'Halifax' addresses:
hidden link

Here are the steps that I'll recommend to fix this on the actual website.

1. Temporarily deactivate all cache and database object cache policies.

2. Go to WP Admin -> Toolset -> Settings -> Maps and use the 'Load stored data' button in the 'Cached data' section.

3. From here remove any records associated with the 'Halifax, NS, Canada' or the coordinates '44.885709, -63.100527'.
( screenshot: hidden link )

4. Once removed, create a temporary 'Therapist' post and use the address 'Halifax, NS, Canada' in any one of the address fields, so that a new map cache record can be created in the database, with the correct coordinates.

After the correct coordinates start showing in the 'Load stored data', you can delete this temporary post.

With the correct 'Halifax, NS, Canada' coordinates in the database, the search in the views should work correctly too.

I hope this helps and please let me know how it goes.

regards,
Waqar

#2604049

Jim

Hi Waqar.

That seems to have done the trick! Thank you very much. You assistance is greatly appreciated.

Jim