Skip to content

Instantly share code, notes, and snippets.

@3manuek
Created April 27, 2016 20:39
Show Gist options
  • Save 3manuek/2146012a17c76acfa0fcbfcc229fa1c7 to your computer and use it in GitHub Desktop.
Save 3manuek/2146012a17c76acfa0fcbfcc229fa1c7 to your computer and use it in GitHub Desktop.
Filtering table using both default and new entries and keeping the alphabetical order
CREATE TABLE bookContentByLine_stopwords(value VARCHAR(30)) ENGINE = INNODB;
INSERT INTO bookContentByLine_stopwords
SELECT value FROM (
SELECT value FROM
INFORMATION_SCHEMA.INNODB_FT_DEFAULT_STOPWORD
UNION
SELECT DISTINCT WORD as value
FROM information_schema.INNODB_FT_INDEX_TABLE
GROUP BY WORD having count(*) > 1000
) allEntries
ORDER BY value ASC;
DROP INDEX ftscontent ON bookContentByLine;
SET GLOBAL innodb_ft_server_stopword_table = 'ftslab/bookContentByLine_stopwords';
CREATE FULLTEXT INDEX ftscontent ON bookContentByLine(content);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment