Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author wpdreams

    (@wpdreams)

    Hi!

    Very strange. Was there any change in the database name? Have you switched to a multisite installation by any chance?

    I’ve tried to trigger ajax requests on your site with different parameters, but I still get no results, so I’m guessing it’s not related to the configuration. The request returns without any visible error, which is good.

    I suppose there is an error generated in the query so the database returns no results. Could you please open up the wp-content/plugins/ajax-search-lite/includes/search_content.class.php file and go to line 255, where you should see this:

    $pageposts = $wpdb->get_results($querystr, OBJECT);

    Ok, now add these lines below that line:

    var_dump($wpdb->last_error);
    var_dump($querystr);
    var_dump($pageposts);

    It will actually change nothing on the output, but I will be able to see the executed query and an error (if any) on my browsers dev tools.

    Let me know, and I will check it again.

    Thread Starter mothershiparts

    (@mothershiparts)

    No, no change to database name or multisite. I added those lines to search_content.class.php – let me know if that helps.

    Plugin Author wpdreams

    (@wpdreams)

    Okays. The good news is that there is no error in the SQL query, it just simply doesn’t match any results, which means there is a configuration issue.

    Based on the query,it looks like that one category or terms with the id “1” is excluded. Maybe the association post types fall under that category/term so they don’t match the pattern. Everything else looks okay.

    I tried to send the request without category exclusions and I got back results, so it must be it: https://i.imgur.com/L2DNkgc.png

    So if you “unexclude” the category on the search settings panel on the backend, the search should work again.

    Thread Starter mothershiparts

    (@mothershiparts)

    I don’t have any exclusions set. It finds what I’m looking for if I click the search button. This is the last bit of my asl_options from the database – there’s nothing excluded here is there?

    “descriptionfield”;s:19:”association_address”;s:17:”excludecategories”;s:0:””;s:12:”excludeposts”;s:0:””;s:18:”wpml_compatibility”;s:1:”0″;s:21:”classname-customtypes”;s:23:”wpdreamsCustomPostTypes”;s:22:”classname-customfields”;s:20:”wpdreamsCustomFields”;s:10:”asl_submit”;s:1:”1″;s:10:”submit_asl”;s:13:”Save options!”;s:25:”classname-showcustomtypes”;s:31:”wpdreamsCustomPostTypesEditable”;s:30:”classname-exsearchincategories”;s:18:”wpdreamsCategories”;s:27:”classname-excludecategories”;s:18:”wpdreamsCategories”;s:20:”selected-customtypes”;a:1:{i:0;s:11:”association”;}s:21:”selected-customfields”;a:3:{i:0;s:19:”association_manager”;i:1;s:19:”association_address”;i:2;s:19:”association_website”;}s:24:”selected-showcustomtypes”;N;s:29:”selected-exsearchincategories”;N;s:26:”selected-excludecategories”;N;}

    Plugin Author wpdreams

    (@wpdreams)

    Indeed, there is nothing excluded. Then this must be a yet unknown bug.

    I will investigate this further, but until then here is a quick solution for you:
    Open up the plugins/ajax-search-pro/includes/search-content.class.php file and go to lines 181-187 where you should see this:

    } else {
       $ex_cat = w_isset_def($searchData['selected-excludecategories'], array());
        if (count($ex_cat) > 0) {
            $words = '--'.implode('--|--', $ex_cat).'--';
            $term_query = "HAVING (ttid NOT REGEXP '$words')";
        }
    }

    Okay, now add this line below those lines (after line 187):
    $term_query = "";

    This will reset the excluded parts and should solve the issue temporary.

    Thread Starter mothershiparts

    (@mothershiparts)

    That did the trick! Thank you so much, great plugin!

    sitiroma

    (@sitiroma)

    good morning!

    I have tried this hacks on my website, but Ajax search lite doesn’t seem to work properly and still don’t bring up any results.
    “No results” appears for any search.
    https://www.itmap.it/roma/tour/scopriroma/religione/basiliche/

    Itmap is multisite.
    Thanks in advance

    Andrea

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘No results!’ is closed to new replies.