Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Problem with searching in custom post › Reply To: Problem with searching in custom post
September 14, 2015 at 10:47 am
#5917
Hi!
I found the problem. It’s possibly a bug when calculating the limit of the mysql query. I’m going to release another bugfix update later today, should be available in 48 hours.
Only a very small modification is needed, you can fix it manually if you want to.
Open up the wp-content/plugins/ajax-search-pro/includes/search/search_indextable.class.php file and go to lines 446-451, where you should see this:
/*----------------------- Optimal LIMIT -------------------------*/
$limit = count(get_option('asp_posts_indexed')) / 2;
$limit = $limit < 200 ? 200 : $limit;
$limit = $limit > 2000 ? 2000 : $limit;
$limit = ($limit * 5) < $searchData['maxresults'] ? ($limit * 5) : $limit;
/*---------------------------------------------------------------*/
change that part to this:
/*----------------------- Optimal LIMIT -------------------------*/
$limit = count(get_option('asp_posts_indexed')) / 2;
$limit = $limit < 200 ? 200 : $limit;
$limit = $limit > 2000 ? 2000 : $limit;
$limit = ($limit * 5) < $searchData['maxresults'] ? ($limit * 5) : $limit;
$limit = floor($limit);
/*---------------------------------------------------------------*/
Hopefully this will solve the problem immediately.
Best,Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)



