Upgrade to Pro — share decks privately, control downloads, hide ads and more …

InnoDBだってシュッと全文検索したい!

 InnoDBだってシュッと全文検索したい!

Rikito Taniguchi

January 11, 2016
Tweet

More Decks by Rikito Taniguchi

Other Decks in Programming

Transcript

  1. ೔ຊޠΛ۠੾ΔͨΊʹ͸ʁ mecab ͢΋΋΋΋΋΋΋΋ͷ͏ͪ ͢΋΋ ໊ࢺ,Ұൠ,*,*,*,*,͢΋΋,εϞϞ,εϞϞ ΋ ॿࢺ,܎ॿࢺ,*,*,*,*,΋,Ϟ,Ϟ ΋΋ ໊ࢺ,Ұൠ,*,*,*,*,΋΋,ϞϞ,ϞϞ ΋

    ॿࢺ,܎ॿࢺ,*,*,*,*,΋,Ϟ,Ϟ ΋΋ ໊ࢺ,Ұൠ,*,*,*,*,΋΋,ϞϞ,ϞϞ ͷ ॿࢺ,࿈ମԽ,*,*,*,*,ͷ,ϊ,ϊ ͏ͪ ໊ࢺ,ඇཱࣗ,෭ࢺՄೳ,*,*,*,͏ͪ,΢ν,΢ν ෼͔ͪॻ͖
  2. CREATE TABLE `test` ( `id` AUTO_INCREMENT NOT NULL PRIMARY KEY,

    `text` varchar(255) NOT NULL, FULLTEXT KEY `ngram_idx` (`text`) ) Engine=InnoDB DEFAULT CHARSET=utf-8; INSERT INTO `test` (`text`) VALUES ( “͢΋΋ɹ΋ɹ΋΋ɹ΋ɹ΋΋ɹͷɹ͏ͪ” ); INSERT INTO `test` (`text`) VALUES ( “͜ΜɹΜʹɹʹͪɹͪ͸” );
  3. CREATE TABLE `test` ( `id` AUTO_INCREMENT NOT NULL PRIMARY KEY,

    `text` varchar(255) NOT NULL, FULLTEXT KEY `ngram_idx` (`text`) WITH PARSER ngram ) Engine=InnoDB DEFAULT CHARSET=utf-8; INSERT INTO `test` (`text`) VALUES ( “͢΋΋΋΋΋΋΋΋ͷ͏ͪ” ); ngram ͷ n ͷ஋͸ ngram_token_size ͰઃఆՄೳ(σϑΥϧτ͸2)