Skip Navigation

[Resolved] Views / Maps Sort by distance incorrect if distance is 0.0 miles

This support ticket is created 4 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

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
- 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/Hong_Kong (GMT+08:00)

This topic contains 26 replies, has 3 voices.

Last updated by Luo Yang 4 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#1517157

I am trying to:
Sort search results by distance

Link to a page where the issue can be seen:
hidden link

I expected to see:
When searching for zip code 01776 I expected to see K T Fenton in the first page of search results. His address is Sudbury, MA 01776 so his distance comes up as 0.0 miles from the center of the search.

Instead, I got:
K T Fenton appears on page 13 of the search results instead of page 1.

#1517269

It seems the partner with 0.0 miles from the search center shows up on random pages of the results, not always 13. I just tested again and he was on page 10. Still not correct (should be on page 1 as it is the nearest match).

#1517943

Hello,

Thanks for the details, I can see the problem in your website, I have tested it with below steps:
1) in location field fill value: Sudbury, MA 01776, USA, click submit button.
2) I see the item "K T Fenton" in page 11.

And I have tried the same setting(same address) in my localhost with a fresh WordPress installation + the latest version of Toolset plugins, there isn't the same problem in my localhost, it works fine, I can see all results are ordered by the distance correctly.

So the problem is abnormal, please check these:
1) Make sure you are using the latest version of Toolset plugins, you can download them here:
https://toolset.com/account/downloads/

2) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2020, deactivate all custom PHP/JS code snippets, and test again

3) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

4) If the problem still persists, please provide database dump file(ZIP file) of your website, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#1519481

If I delete K T Fenton's address and coordinates, save the record and then put the address (zip code / town) back in and save it, the search works correctly.

I worry that other partners may also have issues with their addresses. If you can see what the data issue is and what might have caused it, I'd love to know so I can perhaps figure out how to check the other partners easily with a DB query or something.

#1519497

FYI deleting the address + coordinates, saving, putting the address back in only works if the stored location is also removed first in Settings | Maps | Stored Locations. That's why it didn't work for me before I opened the ticket....

#1519523

Sorry for so many updates... on the live site, deleting the cached address, then deleting the address in the partner record, saving it and re-adding it does not work as it did in my localhost test so that may have been false hope or may indicate an issue with Views 3.0.2 which is what I still need to run on the live site due to the other issue I mentioned earlier.

#1519959

Thanks for the details, I am downloading the files, will update here if there is anything found

#1520369
distance-filter4.JPG

Here are what I found:
I can install the database dump file in my localhost with a fresh WordPress installation, after login into the website dashboard, I see this message:

Toolset Maps: You've got some address data cached. Convert it to a new, more efficient format to gain significant performance benefits on Troubleshooting Page!

Please try these in your website:
Dashboard-> Toolset-> Settings
In the page bottom, click link "Toolset Debug Information",
In the "Toolset Debug Information" page, find section "Convert Maps address cache to new format", click button "Convert cache", it works fine in my localhost, see screenshot distance-filter4.JPG

#1520963

We tried converting cache a while back but had to reverse it when we ran into issues with the Maps update using features in MySQL but not in MariaDB (we host on Kinsta which uses MariaDB). Maps eventually added a work around for this situation so we were able to update to newer Maps.

I tried converting the cache on staging just now and it didn't complete. I got this message:

Found 658 addresses in old cache.
Inserted 269 rows.
Cache could not be converted completely. Do not worry, it will be regenerated from the API.

And the search still doesn't work correctly.

Is there a way to delete the entire cache and let it rebuild?

#1520971

My last reply reminded me that a key difference between my, and probably your, localhost environment and this site is that we're using MySQL and the site is on MariaDB. Just wanted to emphasize that in case it is a clue in your troubleshooting. Especially since we had other issues with Maps and MariaDB in the past that the Toolset developers eventually fixed.

#1525181

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Luo is on holiday today. He will get in touch with you tomorrow as soon as you will back to work.

#1525963

Yes, I get the same message as you mentioned above in my localhost:

...
Cache could not be converted completely. Do not worry, it will be regenerated from the API.

And it works fine as the screenshot I mentioneded above without other actions(delete the entire cache and let it rebuild):
https://toolset.com/wp-content/uploads/2020/02/1520369-distance_filter4.jpg

So there should be other server issuse in your website, I have checked the "Debug information" you provided, you are using Mysql 5.5.5, but according to our document, it is required to use Mysql 5.6 or above:
https://toolset.com/toolset-requirements/

Please try to upgrade your website Mysql server, and test again.

In my localhost, I am using MarioDB 10.2.14

#1526009

The DB is MariaDB, not MySQL but it reports itself as MySQL 5.5.5 for some reason in your debug info. It is actually MariaDB 10.4.7 which is newer than yours so I don't think that is the issue.

#1526027

Since I have tested only your database dump file in my localhost, if there isn't other server issue, it should be a compatibility issue, please provide full copy of your website
https://toolset.com/faq/provide-supporters-copy-site/

#1526131

A duplicator package of this site would be huge. Can you diagnose by logging in to our staging site instead?