Making WordPress.org


Ignore:
Timestamp:
04/26/2016 02:23:48 PM (10 years ago)
Author:
ocean90
Message:

Translate, Consistency: Remove fuzzy search because the query times out.

See #1682.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/routes/class-consistency.php

    r3007 r3013  
    2222
    2323                $search = $set = '';
    24                 $search_fuzzy = false;
    2524                $search_case_sensitive = true;
    2625
     
    4039                }
    4140
    42                 if ( ! empty( $_REQUEST['search_fuzzy'] ) ) {
    43                         $search_fuzzy = true;
    44                 }
    45 
    4641                $locale_is_rtl = false;
    4742                if ( $set ) {
     
    5752                                'search'         => $search,
    5853                                'set'            => $set,
    59                                 'fuzzy'          => $search_fuzzy,
    6054                                'case_sensitive' => $search_case_sensitive,
    6155                        ] );
     
    110104                }
    111105
    112                 if ( $args['fuzzy'] ) {
    113                         $search = $wpdb->prepare( "LIKE {$collation} %s", $wpdb->esc_like( $args['search'] ) . '%%' );
    114                 } else {
    115                         $search = $wpdb->prepare( "= {$collation} %s", $args['search'] );
    116                 }
     106                $search = $wpdb->prepare( "= {$collation} %s", $args['search'] );
    117107
    118108                $locale = $wpdb->prepare( '%s', $locale );
     
    133123                                t.id AS translation_id
    134124                        FROM {$wpdb->gp_originals} AS o
    135                         JOIN 
     125                        JOIN
    136126                                {$wpdb->gp_projects} AS p ON p.id = o.project_id
    137                         JOIN 
     127                        JOIN
    138128                                {$wpdb->gp_translations} AS t ON o.id = t.original_id
    139129                        JOIN
     
    141131                        WHERE
    142132                                p.active = 1
    143                                 AND t.status = 'current' 
     133                                AND t.status = 'current'
    144134                                AND o.status = '+active' AND o.singular {$search}
    145135                                AND ts.locale = {$locale} AND ts.slug = {$slug}
Note: See TracChangeset for help on using the changeset viewer.