Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Create SearchWP database tables by hand
-- Create syntax for TABLE 'wp_swp_cf'
CREATE TABLE `wp_swp_cf` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`metakey` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`term` int(20) unsigned NOT NULL,
`count` bigint(20) unsigned NOT NULL,
`post_id` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `metakey` (`metakey`),
KEY `term` (`term`),
KEY `postidindex` (`post_id`)
) DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci ;
-- Create syntax for TABLE 'wp_swp_index'
CREATE TABLE `wp_swp_index` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`term` bigint(20) unsigned NOT NULL,
`content` bigint(20) unsigned NOT NULL DEFAULT '0',
`title` bigint(20) unsigned NOT NULL DEFAULT '0',
`comment` bigint(20) unsigned NOT NULL DEFAULT '0',
`excerpt` bigint(20) unsigned NOT NULL DEFAULT '0',
`slug` bigint(20) unsigned NOT NULL DEFAULT '0',
`post_id` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `termindex` (`term`),
KEY `postidindex` (`post_id`)
) DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci ;
-- Create syntax for TABLE 'wp_swp_log'
CREATE TABLE `wp_swp_log` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`event` enum('search','action') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'search',
`query` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`tstamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`hits` mediumint(9) unsigned NOT NULL,
`engine` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'default',
`wpsearch` tinyint(1) NOT NULL,
PRIMARY KEY (`id`),
KEY `eventindex` (`event`),
KEY `queryindex` (`query`),
KEY `engineindex` (`engine`)
) DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci ;
-- Create syntax for TABLE 'wp_swp_tax'
CREATE TABLE `wp_swp_tax` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`taxonomy` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL,
`term` int(20) unsigned NOT NULL,
`count` bigint(20) unsigned NOT NULL,
`post_id` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `taxonomy` (`taxonomy`),
KEY `term` (`term`),
KEY `postidindex` (`post_id`)
) DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci ;
-- Create syntax for TABLE 'wp_swp_terms'
CREATE TABLE `wp_swp_terms` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`term` varchar(80) COLLATE utf8mb4_bin NOT NULL DEFAULT '',
`reverse` varchar(80) COLLATE utf8mb4_bin NOT NULL DEFAULT '',
`stem` varchar(80) COLLATE utf8mb4_bin NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
UNIQUE KEY `termunique` (`term`),
KEY `termindex` (`term`(2)),
KEY `stemindex` (`stem`(2))
) DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment