Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Preload search results
- This topic has 10 replies, 2 voices, and was last updated 8 years, 3 months ago by
Steven Maas.
-
AuthorPosts
-
February 17, 2018 at 1:21 am #16823
Steven Maas
ParticipantI was wondering if there are any additional tweaks that I can do to speed up search. For instance I have a search right now that looks at the brokers post type and only have 1 broker. When typing it take a sec or so to show. I was playing around with your settings and noticed that you have
Layout Options > Auto Populate > Display results by default when the page loads (auto populate). I like the idea of populating the search when page loads just not seeing the results until user types. Or start loading search items on field focus in the back ground.Let me know if there is anything else I could do to speed up.
Thanks!
February 17, 2018 at 9:42 am #16824Ernest Marcinko
KeymasterHi!
I believe you are looking for this: Documentation – Fine tuning the search configuration
There are a few methods, especially in section 1 and 2, that may further improve the performance.Pre-loading results is not yet possible. There will be a separate interface within the next 3-4 major releases to allow instant search on certain conditions.
February 17, 2018 at 10:12 am #16826Steven Maas
ParticipantThanks for the tips.
I notice that the jquery.ajaxsearchpro.min.js loads on all pages. I’m only loading the ajax search pro on one page on my site.
How can you just load the jquery.ajaxsearchpro.min.js for just the pages which are using the ajax search pro?
Thanks!
-Steve
February 17, 2018 at 11:01 am #16827Ernest Marcinko
KeymasterHi Steve,
That might be a bit difficult, as in WordPress not ever page has an ID (archives, front etc..). It is however possible to de-register them via a custom code.
I have put together a small custom snippet, which may cover most use cases. Add this custom code to the functions.php in your theme/child theme directory (copy from line 3 only!). Before editing, please make sure to have a full site back-up just in case!Change the $allowed_pages variable to the array of page IDs where you need the search scripts, as well as the $allowed_on_home variable, if the search script should be allowed on the home page.
February 17, 2018 at 8:21 pm #16830Steven Maas
ParticipantHi Ernest:
That code works. I would be nice to have check box option to include ajax js globally. If unchecked it would only load on the specific page. That’s how some my other plugins work.
Thanks!
-Steve
February 18, 2018 at 5:35 pm #16834Ernest Marcinko
KeymasterHi Steve,
I will definitely consider adding a feature to the compatibility options menu to enabled/disable the plugin on some front-end pages.
February 18, 2018 at 5:56 pm #16835Steven Maas
ParticipantHi Ernest,
Thanks for your reply. I did notice that the plugin also places the Ajax Pro css files on all the pages. Is there a way to remove the css from loading on all pages?
<link rel=’stylesheet’ id=’wpdreams-asp-basic-css’ href=’//www.fieldslre.com/wp-content/plugins/ajax-search-pro/css/style.basic.css?ver=zeXszJ’ type=’text/css’ media=’all’ />
<link rel=’stylesheet’ id=’wpdreams-asp-chosen-css’ href=’//www.fieldslre.com/wp-content/plugins/ajax-search-pro/css/chosen/chosen.css?ver=zeXszJ’ type=’text/css’ media=’all’ />Thnkas!
-Steve
February 18, 2018 at 6:14 pm #16836Ernest Marcinko
KeymasterHi!
Sure, this modified version should get rid off those as well:
February 18, 2018 at 6:35 pm #16837Steven Maas
ParticipantHi Ernest:
For some the css is still showing up on all pages.
-Steve
February 20, 2018 at 9:58 am #16853Ernest Marcinko
KeymasterHi!
Indeed, try this one:
February 20, 2018 at 4:31 pm #16864Steven Maas
ParticipantHI Ernest:
That works! I would highly recommend in a next version to include ajax pro files globally or specific pages.
Thanks again!
-Steve
-
AuthorPosts
- You must be logged in to reply to this topic.