Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Last active July 7, 2016 17:34
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jchristopher/f8bb12e2d0e60b22676e to your computer and use it in GitHub Desktop.
Save jchristopher/f8bb12e2d0e60b22676e to your computer and use it in GitHub Desktop.
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