Home › Toolset Professional Support › [Resolved] distance search problem
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 |
---|---|---|---|---|---|---|
- | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | - |
- | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | - |
Supporter timezone: Europe/London (GMT+00:00)
Tagged: Toolset Maps, Views, Views plugin
Related documentation:
This topic contains 12 replies, has 2 voices.
Last updated by silviaF-3 5 years, 9 months ago.
Assisted by: Nigel.
I am trying to make a distance search in my directory (over 20.000 entries all adresses imported with lat, lng and the work well in the archive pages on the map)
But when i put the short code for the distance search in the view an save it via toolset content layout editor: i get the same error like here https://toolset.com/forums/topic/there-was-an-error-during-the-ajax-request-when-using-wordpress-archive-cell/
When i try it with the normal wp page editor and put the view shortcode (splitted to search and results) in i get an error 500 on save and when i view the site.
Maybe the server request is overloaded but in the archive pages (/listing) it works fine. Does the limit in distance search request do not work ?
Any suggestions?
Important: To access the hole site that i send you in your server access form please use user and pw: toolset-temp
Kind regards
Silvia
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
Hi Silvia
I suspect the issue is related to stress on the server, but before going much further can you check your error logs to see if there are PHP errors that would indicate what the problem is?
If you haven't already, turn on the debug log by editing your wp-config.php file and change the line with WP_DEBUG like so:
define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); define('WP_DEBUG_DISPLAY', false);
That will create a debug.log file in your /wp-content/ directory which you can examine in any text editor. Try inserting and testing your View again and then inspect the log. If you don't find the debug.log file it means it didn't generate any warnings or errors.
Let me know what it shows.
Also, as I have credentials to visit your site, can you confirm
1. an example of an archive which is working okay
2. which View you are trying to insert onto which page
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
Hi Silvia
The debug.log isn't appearing, though I do see fatal errors on your site.
I'm taking a copy of the site so that I can install it locally where it will be easier for me to examine, and I'll let you know what I find.
Hi Nigel,
that is nice! Thank you in advance!
Can you tell me where you see these fatal errors?
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
Hi Sylvia
I meant I could see that there must be fatal errors (the page failing to complete) rather than seeing the errors themselves.
I had problems with Duplicator (it is a large site and your server resources don't seem adequate), but I managed to take a copy of your site with All in One WP Migration, and installed that locally.
The errors are indeed Allowed memory size exhausted errors.
However, I still saw these when I significantly increased the resources available on my local server.
I believe that the problem is with the amount of data you have, in combination with how the distance filtering works.
On a View which displays the listing posts on a map which does not include a distance filter, this works fine because you have pagination enabled, and the query returns only 20 listings at a time.
But when you add the distance filter it runs an earlier query to narrow down the possible posts queried by the main query to only include those which appear inside the radius, and it does not make sense for this to be paginated, all 20000 listings must have their distance calculated. That is what is choking the site and stopping it from working.
I'm passing this info on to the developers so that it can be looked at further, but I would not expect a solution soon, and for the time being I'm afraid you simply cannot use the distance filter on a site with so many geo-tagged posts.
Hello Nigel,
first thank you for your advice and your work!
But thats strange, i have a google radius search on my old site with the same amount of entries (on a small webspace) and it works. You can have a look at my old search ( it was an old joomla db with handmade javascript) here: hidden link
So i think it have somthing todo with the query or javascript and not with the server.
Maybe the developers can find a solution...
kind regards
silvia
Hi Nigel,
if i disable one taxonomy category (with 19.000 entries) in the view i get results.
So i take a look in the chrome console and see that your developers does not use json, and i think thats the problem with the requests.
I´m new to wordpress and im not developer more a designer or a try and error programmer 🙂
But if i look deeper in wp development i found out it is better to use the REST-API, this generates JSON response by default which works very fast at my old site
kind regards
silvia
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
Hi Sylvia
That's not how it works. The problem isn't how the data is shipped from server to browser, it's the query taking place on the server to calculate the distances of all the posts which could potentially be included in the results.
If you alter the View so that the number of potential posts for which this calculation must be made then, yes, that will help.
I spoke with the developers who agreed that this needs re-visiting, but it will require a major refactoring of parts of the Maps and Views plugins, and would take place in a major version update to something like Maps 2.0.
In the meantime we are assessing how many clients this affects. (I think you are about the third to report such issues.)
But it means there is no fix that I can give you in the short term, other than suggesting you organise the content in such a way that the number of potential posts being queried at any one time is as small as is practicable.
Thank you very much for your efforts Nigel,
i will try to get my own solution for this, because i need a distance search for all entries....
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
Hi Sylvia
I'm just cleaning up my queue. Although I didn't have a solution for you, I think we can close here. (Feel free to re-open if not.)
Hi Nigel,
now the distance search is working but very very slow, i changed the memory limit to 2048M on the server .
If i make a search in the hole directory (20.000 entries) it took 70seconds for a result or some times i get a timeout.
If i make a search in only 1000 entries it took min. 20 seconds.
If i make a search in one directory with 20 entries it took min. 5 seconds.
It seems that the developer should have a look in his code because the performance is catastrophe the reason of a distance search is not to use it with only 20 entries without results in my position.
I hope that there will soon be a solution, because the distance search is meaningless at the moment (for me)
kind regards
silvia
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
Hi Silvia
Our Maps developer is currently working on a project to significantly change how addresses are stored and queried which should produce substantial improvements on large sites, and he wants examples of actual sites to test on, so I'm making a copy of your site available to him, I hope that's okay.
Hi Nigel,
of course but please treat the data confidentially because of the General Data Protection Regulation.
kind regards
silvia