FULLTEXT searching
I am pretty good with mysql but I haven’t done much full text searching. I have this problem though with getting results. I learned how to do the fulltext searching at the mysql.com site. I plugged their exact example into my database with phpmyadmin and everything good. Then when I make my real table, its not so good. I dont get any results back even with the simplest of queries. I added more rows then all of a sudden the same exact query that didn’t work STARTS WORKING :rolleyes: I am confused so I start deleting rows (rows that weren’t part of my query results) and all I have left are the rows that are significant to my query. And the query doesn’t work again.
I did some searching on google and I found one other person who was having a similar problem. He said the queries would only work if there were >5 rows.
Does anybody have any experience with these problems
-Brad
bwest
Junior Poster in Training
57 posts since Jul 2004
Reputation Points: 14
Solved Threads: 1
Here is the code from www.mysql.com . Notice they do have more than five records.
mysql> CREATE TABLE articles (
-> id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
-> title VARCHAR(200),
-> body TEXT,
-> FULLTEXT (title,body)
-> );
Query OK, 0 rows affected (0.00 sec)
mysql> INSERT INTO articles (title,body) VALUES
-> ('MySQL Tutorial','DBMS stands for DataBase ...'),
-> ('How To Use MySQL Well','After you went through a ...'),
-> ('Optimizing MySQL','In this tutorial we will show ...'),
-> ('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
-> ('MySQL vs. YourSQL','In the following database comparison ...'),
-> ('MySQL Security','When configured properly, MySQL ...');
Query OK, 6 rows affected (0.00 sec)
Records: 6 Duplicates: 0 Warnings: 0
mysql> SELECT * FROM articles
-> WHERE MATCH (title,body) AGAINST ('database');
+----+-------------------+------------------------------------------+
| id | title | body |
+----+-------------------+------------------------------------------+
| 5 | MySQL vs. YourSQL | In the following database comparison ... |
| 1 | MySQL Tutorial | DBMS stands for DataBase ... |
+----+-------------------+------------------------------------------+
2 rows in set (0.00 sec)
bwest
Junior Poster in Training
57 posts since Jul 2004
Reputation Points: 14
Solved Threads: 1
I dont suppose there's anyway to change this? My client may have 30 rows max. (Articles for their clients) This may make searching frustrating when keywords dont get anything.
-B
bwest
Junior Poster in Training
57 posts since Jul 2004
Reputation Points: 14
Solved Threads: 1