Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
188 views
in Technique[技术] by (71.8m points)

mysql - Boolean Full-text returns empty set

I'm using boolean full-text search on a table. This is my database:

 CREATE TABLE `data_mahasiswa` (
  `nim` varchar(11) NOT NULL,
  `nama` varchar(80) NOT NULL,
  `kom` varchar(2) NOT NULL,
  `kota` varchar(100) NOT NULL,
  `ipk` float NOT NULL,
  `email` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `data_mahasiswa`
--

INSERT INTO `data_mahasiswa` (`nim`, `nama`, `kom`, `kota`, `ipk`, `email`) VALUES
('181401002', 'Randy Heksadesianto', 'B', 'Medan', 3.87647, '[email protected]'),
('181401003', 'Nur Azizah Harahap', 'A', 'Binjai', 3.72941, '[email protected]'),
('181401004', 'Istikanah Wulandari', 'C', 'Asahan', 3.71176, '[email protected]'),
('181401005', 'Chyntia Wilhelmine Nainggolan', 'B', 'Batu Bara', 3.79412, '[email protected]');

I'm trying to query data with kom "B" in them, I've tried:

select * from data_mahasiswa where match(kom) against ('+B' in boolean mode);

But it returns an empty set Empty set (0.001 sec) There should be a result,as there are 2 row with "B" as kom

How can I fix this? Any help is much appreciated, thank you.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...