Index Table

This topic contains 9 replies, has 2 voices, and was last updated by mmerrywest mmerrywest 6 years ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #9604
    mmerrywest
    mmerrywest
    Participant

    Hi,

    I have the plugin installed and it was working fine. with more content it became slow, so I have tried turning on the index table, but it says it can’t create it and to contact support. I saw from the knowledgeable this may be to do with DB permissions, so I completely removed and re-added, but the plugin did not make the tables – may be some help, or may be a red herring.

    Unfortunately the site is on an internal intranet, but I am able for you to share my screen

    Mark

    #9605
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    The most common cause of these types of issues are executed shortcodes, which are parsed along with the content when generating the index table.
    Luckily it is possible to turn them off. Please go to the Advanced Options panel on the Index table submenu, and turn OFF the Execute Shortcodes? option: https://i.imgur.com/bKUaPkz.png

    Then save the options and try to re-create the index table. Hopefully it should start working now.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #9606
    mmerrywest
    mmerrywest
    Participant

    Hi

    I don’t get any options?

    The index table does not exist and cannot be created. Please contact support.

    Mark

    #9607
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Oh sorry, I’ve misread the issue.

    In that case, you can create the table manually instead by running the queries below. Don’t forget to replace the “wp_” prefix in “wp_asp_index” to the table prefix you are using (if different):

    Table creation:

    Indexes:

    That should do the trick.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #9608
    mmerrywest
    mmerrywest
    Participant

    Nope, same issue unfortunately. Table created ok, but link is the wp-admin still has the same message

    #9609
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    That is very interesting. My only guess is that the DB account that wordpress uses does not have permissions to the SHOW command (?), so it’s not able to check it’s existence. It only makes sense to me this way.

    If the table is indeed there correctly, then I guess it’s safe to ignore this check, as it makes no difference whatsoever. For that you will have to make a modification. Open up the wp-content/plugins/ajax-search-pro/includes/etc/indextable.class.php file and scroll to lines 154-168, which should be this function:

    function checkIndexTable( $create_if_not_exist = false ) {
    	global $wpdb;
    
    	$table_name = $this->asp_index_table;
    	if ( $wpdb->get_var( "SHOW TABLES LIKE '$table_name'" ) != $table_name ) {
    		if ( $create_if_not_exist === true ) {
    			$this->createIndexTable();
    
    			return $this->checkIndexTable( false );
    		} else {
    			return false;
    		}
    	}
    
    	return true;
    }

    Replace that function with simply this:

    function checkIndexTable( $create_if_not_exist = false ) {
    	return true;
    }
    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #9610
    mmerrywest
    mmerrywest
    Participant

    Hmm, it now gets me to the settings page described before and I have turned off execute shortcodes. It seems to make an index and shows a success message, but when I look in the DB table – its empty!

    #9611
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Are you sure that the index table name is correct? It would explain the previous and this issue as well.

    The default wordpress table prefix is “wp_”, but in some cases it’s different. So the default index table name becomes “wp_asp_index”. Can you please check that? Is your table prefix “wp_” ?

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #9612
    mmerrywest
    mmerrywest
    Participant

    sent screenshot by email

    #9613
    mmerrywest
    mmerrywest
    Participant

    Ok, tested the functionality and it is working, so it must be putting them somewhere, I can trace it from here

    Many thanks for all your help

    Mark

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.