Click here to Skip to main content
15,894,539 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I created a table in MySQL which contains a FULLTEXT index and inserted a record into that table. When I do a FULLTEXT search, the result would be: "Empty set (0.00 sec)".
What's the problem?

The codes:
SQL
CREATE TABLE t1(
name NVARCHAR(25),
family NVARCHAR(25),
FULLTEXT(name, family)) ENGINE MyISAM;

INSERT INTO t1(name, family) VALUES('saleh', 'negahdari');

SELECT * FROM t1 WHERE
MATCH(name, family) AGAINST('saleh');
Posted
Updated 30-Jul-14 9:43am
v5
Comments
Sergey Alexandrovich Kryukov 30-Jul-14 16:24pm    
Maybe the correct result of this query is really an empty set, why not?
—SA
salehne 31-Jul-14 9:05am    
Because I have already inserted the result(a record!) into the table, so the result should be a found record! But it doesn't work, and I don't know why!!

1 solution

A problem is that you have inserted only one row to the test table.
If you RTFM[^] you'll notice that FULLTEXT indexes use natural language search as default search mode and that words that are present in 50% or more of the rows are considered common and do not match.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900