MYSQL匹配反对不正确匹配

时间:2013-12-09 16:55:13

标签: mysql database full-text-search

这是我的架构:

DROP TABLE products;
CREATE TABLE products (
    model VARCHAR(50) PRIMARY KEY,
    make VARCHAR(10) NOT NULL, /* symphony, autobus */
    categories VARCHAR(20), /* tv, multimedia, head-unit, speaker, graphic-equalizer,
                 base-tube, speaker-box, power-amplifier, alarm-system,
                 car-monitor, automatic-antenna, rear-view-camera,
                 emergency-light, tweeter, subwoofer
                  */
    specs TEXT,
    pic VARCHAR(100) DEFAULT 'symphony.gif',
    FULLTEXT (model, categories, specs)
) ENGINE=MyISAM;

以下是我数据库中的一些数据:

INSERT INTO products (MODEL, SPECS, CATEGORIES, PIC, MAKE) VALUES ("SY-2450U", "<li>Front AUx IN</li><li>CD/MP3/WMA playback</li><li>MP3 folder and file display</li><li>MP3 track/file</li> <li>4 channels x 40W MAx power output</li><li>Rotary volume encoder</li><li>4-band EQ (Classic, pop, rock, flat) </li>","head-unit","SY-2450U.jpg", 'symphony');
INSERT INTO products (MODEL, SPECS, CATEGORIES, PIC, MAKE) VALUES ("SY-U580SD7","<li>7 Different illumination colors</li> <li>MP3/WMA Playback</li> <li>Clock Display</li> <li>Station seek/Audio store</li> <li>Rotary volume encoder</li> <li>multiband EQ </li>","head-unit","SY-U580SD7.jpg", 'symphony');
INSERT INTO products (MODEL, SPECS, CATEGORIES, PIC, MAKE) VALUES ("SY-U560SD","<li> Clock Display</li><li>PLL tuner with 18FM/12AM presets</li><li>Station seek/Auto store</li><li>Rotary volume encoder</li><li>Multi band EQ</li><li>2 Channel x 2V line out</li>","head-unit","SY-U560SD.jpg", 'symphony');
INSERT INTO products (MODEL, SPECS, CATEGORIES, PIC, MAKE) VALUES ("SY-U550SD","<li> Clock Display</li><li>PLL tuner with 18FM/12AM presets</li><li>Station seek/Auto store</li><li>Rotary volume encoder</li><li>Multi band EQ</li><li>2 Channel x 2V line out</li>","head-unit","SY-U550SD.jpg", 'symphony');
INSERT INTO products (MODEL, SPECS, CATEGORIES, PIC, MAKE) VALUES ("SY-540SD","<li> Clock Display</li><li>PLL tuner with 18FM/12AM presets</li><li>Station seek/Auto store</li><li>Rotary volume encoder</li><li>Multi band EQ</li><li>2 Channel x 2V line out</li>","head-unit","SY-540SD.jpg", 'symphony');
INSERT INTO products (MODEL, SPECS, CATEGORIES, PIC, MAKE) VALUES ("SY-U540SD","<li>Detachable  panel Car MP3 player with USB/SD slot</li> <li>Playing tracks at  Repeat/Random/Intro mode</li> <li>FM/AM Radio System  30 Preset Radio Stations</li> <li>Auto Tuning Seek Control</li>  <li>Mute function  With ID3 function  With Remote control</li><li>High power output 4x45W(Original TDA7388 IC)</li>","head-unit","SY-U540SD.jpg", 'symphony');
INSERT INTO products (MODEL, SPECS, CATEGORIES, PIC, MAKE) VALUES ("SY-520SD","<li> Detachable  panel Car MP3 player with USB/SD slot</li> <li>Reading  MP3 / WMA files</li> <li>Playing tracks at  Repeat/Random/Intro mode</li> <li>Auto Tuning Seek Control</li>  <li>Front AUx input</li> <li>Mute function With ID3 function With Remote control</li></li>","head-unit","SY-520SD.jpg", 'symphony');
INSERT INTO products (MODEL, SPECS, CATEGORIES, PIC, MAKE) VALUES ("SY-U480SD", "<li>Detachable panel with LCD display</li> <li>MP3 playback from front USB device , SD/MMC card</li>  <li>MP3 ID3 tag display: Title, Artist and Album</li>  <li>4 channels x 40W MAx power output</li>  <li>4 channels x 20W RMS power output</li>  <li>4-band EQ (Classic, pop, rock, flat)</li>","head-unit","SY-U480SD.jpg", 'symphony');
INSERT INTO products (MODEL, SPECS, CATEGORIES, PIC, MAKE) VALUES ("SY-460USD", "<li>Reading MP3 / WMA files</li> <li>Playing tracks at Repeat/Random/Intro mode</li> <li>30 Preset Radio Stations</li> <li>Auto Tuning Seek Control</li><li>Mute function With Remote control</li>  <li>High power output 4x45W(Original TDA7388 IC) </li>","head-unit","SY-460USD.jpg", 'symphony');
INSERT INTO products (MODEL, SPECS, CATEGORIES, PIC, MAKE) VALUES ("SY-440USD", "<li>Reading MP3 / WMA files</li> <li>Playing tracks at Repeat/Random/Intro mode</li> <li>30 Preset Radio Stations</li> <li>Auto Tuning Seek Control</li><li>Mute function With Remote control</li>  <li>High power output 4x45W(Original TDA7388 IC) </li>","head-unit","SY-440USD.jpg", 'symphony');

这是我的查询和输出(没有意义):

    mysql> SELECT MATCH (model, specs, categories) AGAINST ('mp3' IN NATURAL LANGUAGE MODE) AS relevance, categories, model, pic FROM products WHERE make='symphony' AND MATCH (model, specs, categories) AGAINST ('mp3' IN NATURAL LANGUAGE MODE);
Empty set (0.00 sec)

0 个答案:

没有答案