473,246 Members | 1,487 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,246 software developers and data experts.

MySQL WHERE MATCH problem

Hi,

I have the following table

CREATE TABLE `fulltext_sample` (
`copy` text,
FULLTEXT KEY `copy` (`copy`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

INSERT INTO `fulltext_sample` VALUES ('This is a test to see how mysql
works');

Now I do a search for
SELECT * FROM fulltext_sample WHERE MATCH(copy) AGAINST('mysql');
and it return 0 results. Can someone please help me with this?

Thanks
Maz.
Jul 17 '05 #1
2 1775
Maziar,
I have the following table

CREATE TABLE `fulltext_sample` (
`copy` text,
FULLTEXT KEY `copy` (`copy`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


First you should always use an id field now...

If you look at the mysql manual for fulltext
(http://dev.mysql.com/doc/mysql/en/fulltext-search.html) the correct
way to create the table would be:
CREATE TABLE fulltext_sample (
id id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
copy TEXT,
FULLTEXT (copy)
);

What you pretty much did wrong at the top was trying to create a key. I
do not know exactly how mysql parses that but you may want to try over
with an ID column and the column for a copy.

Mike
Jul 17 '05 #2
Maziar,
What you pretty much did wrong at the top was trying to create a key. I
do not know exactly how mysql parses that but you may want to try over
with an ID column and the column for a copy.


Also one more quick note. From the manual:
" The search result is empty because the word ``MySQL'' is present in at
least 50% of the rows. As such, it is effectively treated as a stopword.
For large datasets, this is the most desirable behavior---a natural
language query should not return every second row from a 1GB table. For
small datasets, it may be less desirable."

Mike
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: renster | last post by:
Hi, I was wondering if anyone here had a decent solution to this mysql/php problem. I have a mysql database with a list of groups (group_id, group_name, group_location, group_time,...
0
by: Phil Powell | last post by:
The table already has a fulltext index and from there I can use the MySQL fulltext search query to get results as well as the relevancy score. The problem I have is that MySQL has a default...
4
by: Hal Halloway | last post by:
can mysql work in Windows but not Solaris? Is there any reason you can see why the fulltext php/mysql code below works OK on my win2k php4.3.6. mysql 4.1.3 pc but does *not* work when put on a...
0
by: Lenz Grimmer | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, MySQL 4.0.14, a new version of the popular Open Source/Free Software Database, has been released. It is now available in source and binary...
0
by: Henry Hank | last post by:
Environment: I'm setting up a database server on a Dell Poweredge 2650, dual 1.8GHZ pentium with 1GB of memory and RAID5 drives. I've installed RedHat 9, and updated the kernel to 2.4.20-19.9smp....
0
by: Phil Powell | last post by:
I have a rather complicated query with a combination of LEFT JOINs and two MATCHES where the first match is non-boolean to get the accurate score, the second to search as boolean: SELECT...
175
by: Sai Hertz And Control Systems | last post by:
Dear all, Their was a huge rore about MySQL recently for something in java functions now theirs one more http://www.mysql.com/doc/en/News-5.0.x.html Does this concern anyone. What I...
4
by: Vanessa | last post by:
Hi there I am an Access developer, and I have written applications for a 30 telephone call center, using the standard multiuser jet engine, it all works fine, but I want to move our systems onto...
14
by: mistral | last post by:
Need php script to create mySQL database programmatically; since hosting configuration may not allow create database from script, script also need eliminate/rewrite all restrictions in appropriate...
5
by: Jagadish Kumar, Maripi | last post by:
Hi, I got the following error while trying to compile php with mysql. I would be glad if anyone can help me on this. Here is the error that i've got in config.log The command i used is:...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.