Automattic\WooCommerce\Internal\Utilities

DatabaseUtil::fts_index_on_order_item_table_existspublicWC 1.0

Check if fulltext index with key order_item_fts on order item table exists.

Method of the class: DatabaseUtil{}

No Hooks.

Returns

true|false.

Usage

$DatabaseUtil = new DatabaseUtil();
$DatabaseUtil->fts_index_on_order_item_table_exists(): bool;

DatabaseUtil::fts_index_on_order_item_table_exists() code WC 10.7.0

public function fts_index_on_order_item_table_exists(): bool {
	global $wpdb;
	$order_item_table = $wpdb->prefix . 'woocommerce_order_items';
	// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- $order_item_table is hardcoded.
	return ! empty( $wpdb->get_results( "SHOW INDEX FROM $order_item_table WHERE Key_name = 'order_item_fts'" ) );
}