[wp-trac] [WordPress Trac] #51769: Full-text search support

WordPress Trac noreply at wordpress.org
Fri Nov 27 15:07:09 UTC 2020


#51769: Full-text search support
------------------------------------+------------------------------
 Reporter:  zieladam                |       Owner:  (none)
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  Database                |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:  dev-feedback has-patch  |     Focuses:
------------------------------------+------------------------------

Comment (by zieladam):

 @azaozz raised a great concern about the performance of these queries:

 {{{#!php
 <?php
 $wpdb->query( "ALTER TABLE $wpdb->posts ADD FULLTEXT INDEX
 `wp_posts_fulltext_title` (`post_title` ASC);" );
 $wpdb->query( "ALTER TABLE $wpdb->posts ADD FULLTEXT INDEX
 `wp_posts_fulltext_excerpt` (`post_excerpt` ASC);" );
 $wpdb->query( "ALTER TABLE $wpdb->posts ADD FULLTEXT INDEX
 `wp_posts_fulltext_content` (`post_content` ASC);" );
 }}}


 Indeed that could easily time out when there are many posts in the
 database. Still, there are many sites where that would not be a problem.


 We brainstormed a solution that would offer users the best sensible
 defaults:

 * WP upgrade flow would attempt to create these indexes one time only.
 Perhaps we could reduce the number of people experiencing these timeouts
 by short-circuiting if `SELECT COUNT(*) from wp_posts` is a large number
 (how large?)
 * If the indexes are successfully created, that's great and full-text
 search becomes available on the site. It could be enabled/disabled via
 site settings.
 * If the operation times out or otherwise fails, it will not be attempted
 again. Refreshed upgrade screen would include a short note about how Full-
 text search is available in WP 5.7 but could not be automatically enabled,
 and then link to a documentation page with further details. The same note
 would be displayed instead of the related site setting.

 In this scenario, the upgrade would be automatic and the failure would
 handled gracefully.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51769#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list