Automattic\WooCommerce\Internal\Utilities

DatabaseUtil::create_fts_index_order_item_tablepublicWC 1.0

Create a fulltext index on order item table.

Method of the class: DatabaseUtil{}

No Hooks.

Returns

null. Nothing (null).

Usage

$DatabaseUtil = new DatabaseUtil();
$DatabaseUtil->create_fts_index_order_item_table(): void;

DatabaseUtil::create_fts_index_order_item_table() code WC 10.7.0

public function create_fts_index_order_item_table(): void {
	global $wpdb;
	$order_item_table = $wpdb->prefix . 'woocommerce_order_items';
	// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- $order_item_table is hardcoded.
	$wpdb->query( "CREATE FULLTEXT INDEX order_item_fts ON $order_item_table (order_item_name)" );
}