Disable live search function

Posted in: Newspaper
Post count: 27

Hello,

Is it possible to disable the live search function from the search box, and if yes, how can this be done?

Thanks!

Post count: 23312

Hello cre8,

If you want to disable the Live Search you should comment out or remove the static function on_ajax from td_ajax.php from here -> https://www.screencast.com/t/yB6NVkYLig Clear all the caches and check the results.

Thanks.

Post count: 23

Hi also have tried this and it seems to break the Next Prev ajax on the Blocks pagnation. Is there a particular line in the code that should not be commented out?

Post count: 23312

Hello ieanea,

You should only comment out the live search function from the code, as I have pointed you above.

Thanks.

Post count: 68

Hello Catalin,

I was looking here in the forum on this subject since I have had problems of ouverload of CPU with the Search Live.

I tried to apply the suggested configuration in tg_ajax.php, exactly as explained, but after that it break the Next Prev ajax on the Blocks pagnation and the ajax views counter for cached pages, as reported by our colleague ieanea above.

Is there a setting that disables ajax only for Live Search?

Thank you!

Post count: 23312

Hi,

If you want to disable the Live Search you should comment out or remove the static function on_ajax from td_ajax.php from here -> https://www.screencast.com/t/yB6NVkYLig Clear all the caches and check the results.

Thanks.

Post count: 205

I just want to stop ajax live search for pages only.
So let’s be enabled for Posts…and disable for pages.
Thanks

Post count: 23312

Hello Viju,

Unfortunately, the theme does not have any such an option that allows you to do this only for pages or posts, sorry! You should customize it yourself and if you are not aware of the steps which are needed to follow in this case, consider hiring a freelancer/developer to help you!

Thanks for the message!

Post count: 11

I know this is an old thread, but is there a place to put in a feature request to be able to disable the live search from the Theme Panel. We have several sites which have over 100k posts and the live search thrashes the database. Since it does auto search as you type, it can fire off multiple queries. For instance the query that gets ran is

SELECT SQL_CALC_FOUND_ROWS 2h7sq1pIz_posts.ID FROM 2h7sq1pIz_posts WHERE 1=1 AND (((2h7sq1pIz_posts.post_title LIKE '%Paint%') OR (2h7sq1pIz_posts.post_excerpt LIKE '%Paint%') OR (2h7sq1pIz_posts.post_content LIKE '%Paint%')) AND ((2h7sq1pIz_posts.post_title LIKE '%number%') OR (2h7sq1pIz_posts.post_excerpt LIKE '%number%') OR (2h7sq1pIz_posts.post_content LIKE '%number%')) AND ((2h7sq1pIz_posts.post_title LIKE '%game%') OR (2h7sq1pIz_posts.post_excerpt LIKE '%game%') OR (2h7sq1pIz_posts.post_content LIKE '%game%'))) AND 2h7sq1pIz_posts.post_type IN ('page', 'post') AND (2h7sq1pIz_posts.post_status = 'publish' OR 2h7sq1pIz_posts.post_status = 'hidden' OR 2h7sq1pIz_posts.post_status = 'expired' OR 2h7sq1pIz_posts.post_status = 'tribe-ea-success' OR 2h7sq1pIz_posts.post_status = 'tribe-ea-failed' OR 2h7sq1pIz_posts.post_status = 'tribe-ea-schedule' OR 2h7sq1pIz_posts.post_status = 'tribe-ea-pending' OR 2h7sq1pIz_posts.post_status = 'tribe-ea-draft' OR 2h7sq1pIz_posts.post_author = 15962 AND 2h7sq1pIz_posts.post_status = 'private') ORDER BY (CASE WHEN 2h7sq1pIz_posts.post_title LIKE '%Paint by number game%' THEN 1 WHEN 2h7sq1pIz_posts.post_title LIKE '%Paint%' AND 2h7sq1pIz_posts.post_title LIKE '%number%' AND 2h7sq1pIz_posts.post_title LIKE '%game%' THEN 2 WHEN 2h7sq1pIz_posts.post_title LIKE '%Paint%' OR 2h7sq1pIz_posts.post_title LIKE '%number%' OR 2h7sq1pIz_posts.post_title LIKE '%game%' THEN 3 WHEN 2h7sq1pIz_posts.post_excerpt LIKE '%Paint by number game%' THEN 4 WHEN 2h7sq1pIz_posts.post_content LIKE '%Paint by number game%' THEN 5 ELSE 6 END), 2h7sq1pIz_posts.post_date DESC LIMIT 0, 10

so imagine that query 10+ times but searching for pa pain paint b paint by nu paint by number paint by numbers in the matter of 5 seconds. Then when you account for multiple people searching on the site at the same time, you can see how the queries could add up quick.

I love the feature for smaller sites that we do, but with larger sites, it would be nice to not have to modify the parent theme, which gets overwritten each upgrade, and to simply have a toggle on the Theme Panel.

Post count: 44

+1 on providencebusiness’s request. Or, would it be possible to manually modify the on_ajax_search function to only use the last x amount of posts in a live search?

Post count: 23312

Hi,

Thank you for your suggestion! At the moment, the theme does not have any such an option and functionality! If our developers will consider implementing this in future updates, it will be implemented, if not, will do not be implemented.

Thank you!

Viewing 11 posts - 1 through 11 (of 11 total)
The forum ‘Newspaper’ is closed to new topics and replies.