Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Performance of large results sets
- This topic has 11 replies, 2 voices, and was last updated 6 years, 2 months ago by
Ernest Marcinko.
-
AuthorPosts
-
March 13, 2020 at 5:54 pm #26251
thenetking24
ParticipantWhile researching your plugin, I came across a few questions about max number of items the plugin can handle. I believe there were claims that 5-10k items would be fine.
The client has 400 items loaded, with 24 items being displayed on each page. The initial page load takes 10 seconds or more on a pretty powerful server. I have not looked at scaling images down for these thumbnail views, so the images are still full res and rather large. But I don’t understand why its loading all 400 items that are mostly sitting behind pages that are not currently active/in view.
Is there an easy way to lazy load these images?
What does it take to use wordpress image resizing to get the thumbnails loading the smaller images?
Thanks
March 14, 2020 at 10:40 am #26254Ernest Marcinko
KeymasterHi,
Loading 400 items at the same time via the plugin? I am not sure if that is a good idea whatsoever. That is not the same as searching for a few dozen of items from a potential list of hundreds of thousands of posts. Pushing that many elements to one page will definitely spike the browser perfromance, it is no longer an issue that the plugin has to handle. The actual search may only take a fraction of second, but then parsing all the item titles, requesting the images from the database etc.. can be really painful to any server, and then displaying all that information in the browser is a task for the client PC.
There is actually a built-in lazy loading script that you can enable, it will not load the images until paginated or in viewport. I would also strongly recommend enabling caching, it will help tremendously for displaying 400 items at once.
There is also an automatic image cropping script that creates the closest image thumbnail sizes to the results.You can also define the preferred image source sizes under the General Options -> Image options panel.
March 14, 2020 at 10:53 am #26256thenetking24
ParticipantThank you.
I understand the issue with sending so many results to the browser, but I am was only expecting the browser to have to worry about a single page of results at a time.
The built in lazy loading sounded like what I needed, but it’s already enabled and doesn’t seem to change functionality. Clicking on any page has the images loaded into memory already.
I was under the impression the initial load would show 1 – 24 of 5000 results, and only load the 24 results of the first page, and then only load the images of whatever page the user attempts viewing. And then if the user picks a category or completes a search that has up to say 500 results, it would do the same thing. Is there a different, better way to load these results?
Thanks again
March 14, 2020 at 11:18 am #26257Ernest Marcinko
KeymasterHi,
In that case I would suggest using the more result loader. It will automatically trigger the search when reaching the last page (or result) to load more of them.
It is hard-limited to load at max 10 batches of the actual limit. So if you set a results limit 24, then the script will trigger 10 times at most, giving approximately 240 results, no more. Each batch loads additional 24 items.March 14, 2020 at 12:03 pm #26258thenetking24
ParticipantAre there other settings that will cause this not to function? I’ve had it enabled recently but the client did not like the functionality.
I am trying to enable it now and nothing is changing on the front end.
March 14, 2020 at 12:10 pm #26259Ernest Marcinko
KeymasterHave you decreased the results limit?
March 14, 2020 at 12:14 pm #26260thenetking24
ParticipantGeneral options – Limits – Post type results limit is set to 999, on results page is set to 999.
General options – Logic & Behavior – Results count per page? is set to 999.Is there anywhere else to check for this limit?
March 16, 2020 at 8:38 am #26268Ernest Marcinko
KeymasterHi,
General Options -> Limits, that is the one for search results. You should lower that to the number, that you want to see at the first iteration (24 or 20 or 30 or whatever fits best).
Also, check this option (if it’s not disabled automatically), and change it to the same number.March 17, 2020 at 7:46 pm #26288thenetking24
ParticipantThanks again,
I’ve spent some time playing with different setups and limits. I am extremely confused why I am not able to get this functioning decently. Setting Options -> limits to 24 causes the max results to stop at 240, which is inline with what you mentioned previously. So is the only way to show more of a potentially 25,000 item database, to increase this per page limit to a 10th of 25k?
Is there any method to cause this to load pages/pagination the same way wordpress does by default, where it only pulls the items per page? Would the new elementor setup allow me to create an “archive home” that has pagination working this way with the filters?
I’m stuck trying to understand how this can handle databases of 25k and I can’t get a couple hundred items to display in any type of reasonable time. Am I using options or configurations that cause this delay, or is this delay not a consideration when handling large data sets?
Thank you
March 18, 2020 at 10:04 am #26289Ernest Marcinko
KeymasterAgain, searching and displaying a minor subset of 25k items is very different from displaying 25k items at once.
What you are looking for is to display a number of elements at once, per page, and possibly refresh that page, when the user hits the pagination. The plugins live results container is not built for this, it is to display thousands of items at once obviously, browsers will have a hard time with that.I can think of two possibilites:
1. To increase the iteration count to display more results at once within the live container. By default this number is 10, the custom code below increases it to 100. Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!
add_filter( 'asp_query_args', 'asp_change_remaining_limit_mod', 10, 2 ); function asp_change_remaining_limit_mod( $args, $id ) { $args['_remaining_limit_mod'] = 100; return $args; }2. Instead of the default live results container, use an Elementor posts widget. This is a fairly new feature, but it works almost exactly as you need it. The pagination will refresh the page every time.
March 20, 2020 at 5:43 pm #26331thenetking24
ParticipantThanks, the elementor setup solves the performance issue once I hack this interface to look like the other.
Is there any chance I can call just the filters and just the search bar, the other shortcodes don’t seem to change this output.
Is there a way to do this with WordPress query code instead of elementor?
Thanks again
March 22, 2020 at 11:15 am #26344Ernest Marcinko
KeymasterIs there any chance I can call just the filters and just the search bar, the other shortcodes don’t seem to change this output.
I don’t understand what do you mean by this, can you please explain?Is there a way to do this with WordPress query code instead of elementor?
Unfortunately no, there is no wordpress integrated shortcode/element that supports this. You can do it on the results page via the live loader feature, but that is different. -
AuthorPosts
- You must be logged in to reply to this topic.