• Resolved demandtc

    (@demandtc)


    Hi, I used TranslatePress for a while and everything worked fine. But yesterday I added translatable strings to my own wordpress plugin and tried to translate them. It worked at first, but then If go onto the site where the translations happens I get the default language and an error in my error-log:

    WordPress database error Can't find FULLTEXT index matching the column list for query SELECT original,translated, status FROM wp_trp_gettext_de_de WHERE status != 0 AND original != 'Survey by' AND MATCH(original) AGAINST ('Survey by' IN NATURAL LANGUAGE MODE ) LIMIT 3 made by do_action('wp_ajax_trp_get_similar_string_translation'), WP_Hook->do_action, WP_Hook->apply_filters, TRP_Translation_Memory->ajax_get_similar_string_translation, TRP_Translation_Memory->get_similar_string_translation

    I have the latest WordPress and Plugin Version and try to translate from default English to German.

    I get this error for both languages on reloading the page. (means also for wp_trp_gettext_en_us)

    • This topic was modified 4 months, 2 weeks ago by demandtc.
Viewing 1 replies (of 1 total)
  • Hello there,

    It’s possible that the index file of a column from _trp_dictionary_ table was lost when the database was migrated.

    You should create indexes for your tables using the following code:

    1. Create an empty plugin like this: https://gist.github.com/sareiodata/76f701e01db6685829db

    2. Add the following code to the end of it:

    function trpc_add_full_text_index_to_tables(){<br />

    $trp = TRP_Translate_Press::get_trp_instance();
    $trp_query = $trp->get_component( 'query' );
    global $wpdb;


    $table_names = $trp_query->get_all_table_names('', array());
    $gettext_table_names = $trp_query->get_all_gettext_table_names();


    foreach (array_merge($table_names, $gettext_table_names) as $table_name){
    $possible_index = "SHOW INDEX FROM {$table_name} WHERE Key_name = 'original_fulltext';";
    if ($wpdb->query($possible_index) === 1){
    continue;
    };


    $sql_index = "CREATE FULLTEXT INDEX original_fulltext ON
    " . $table_name . "(original);";
    $wpdb->query( $sql_index );
    }
    }

    add_action('init', 'trpc_add_full_text_index_to_tables');

    3. Install this plugin via FTP (copy it inside wp-content/plugins) or create a zip archive with it and install it via the WordPress plugin upload functionality

    After the indexes are created you can disable this plugin.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.