|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
MATCH AGAINST problem
Hi,
I created a table news with 3 fulltext fields like this CREATE TABLE news ( nid int(11) NOT NULL auto_increment, category int(4) NOT NULL default '0', author int(11) NOT NULL default '0', title varchar(50) NOT NULL default '', intro varchar(255) NOT NULL default '', content text NOT NULL, newsdate datetime default NULL, PRIMARY KEY (nid), FULLTEXT KEY intro (intro), FULLTEXT KEY content (content), FULLTEXT KEY title (title) ) TYPE=MyISAM; Now, I created a simple query: SELECT * FROM news WHERE MATCH (content) AGAINST ('blah'); Im not receiving any errors but Im getting zero results although there is one record containing 'blah' What could be the problem? |
|
#2
|
|||
|
|||
|
RE: MATCH AGAINST problem
how many rows do you have in a table, what oter data do you have..
anyway, look at nice examples in the mysql man.. http://www.mysql.com/doc/en/Fulltext_Search.html |
|
#3
|
|||
|
|||
|
RE: MATCH AGAINST problem
I have two rows
INSERT INTO news VALUES (1, 1, 2, 'Fujifilm predstavlja karticu od 512MB', 'Fuji Photo Film U.S.A., Inc. je lider u inovacijama kada su proizvodi iz sveta digitalne fotografije u pitanju. Ovog puta predstavljena je nova xD-Picture Card™ kartica kapaciteta 512 megabajta.', '<img src="./upload/Tehnologija/512MB_xd_card.jpg" width="85" height="69" border="0">', 'Format kartica "xD-Picture Card™" je razvijen od strane kompanija Fujifilm i Olympus i prvi put je prikazana u septembru 2002. godine. Ova kartica bi trebala da zadovolji sve potrošaèe koji imaju potrebu za veæim kapacitetom. Razvijanje xD-Picture™ kartica se predviða do kapaciteta od 8 gigabajta. Treba pomenuti da se ova kartica proizvodi u varijantama od 16MB, 32MB, 64MB, 128MB, 256MB i od skoro 512MB. Kartica je kompaktna i dimenzije su joj samo 20.0 x 25.0 x 1.7 mm. Pored toga sve kartice kapaciteta veæih od 64MB su veoma brze i u moguænosti su da èitaju podatke brzinom od 5MB u sekundi, dok ih upisuju brzinom od 3MB u sekundi.', 0, '2003-07-15 19:37:57', 8, 1); INSERT INTO news VALUES (2, 3, 2, 'Novi PowerShot G5 iz kompanije Canon', 'Kompanija Canon je lansirala na tržište novi digitalni fotoaparata sa rezolucijom od pet megapiksela. Ovaj ozbiljni ureðaj predstavlja kombinaciju brzine, portabilnosti, i kreativnosti koja æe omoguæiti pun set opcija za sve foto entuzijaste.', '', 'Canon PowerShot G5 može uslikati fotografije u rezoluciji od 2592 x 1944 piksela. Njegov optièki zum je èetvorostruki, kao i digitalni. Pored ovih karakteristika poseduje i LCD displej koji je moguæe rotirati za èak 270 stepeni.rnrnKomplet PowerShot G5 ukljuèuje:rn- 32MB CompactFlash karticurn- BP-511 Lithium-Ion baterijurn- ArcSoft Camera Suite CD-ROMrn -Digital Camera Solution CD-ROM rn- Compact Power Adapter CA-560 sa A/C kablom i USB kablomrn- AV kablrn- bežièni daljinski upravljaèrn- poklopac za objektivrnrnDigitalni fotoaparat PowerShot G5 je u prodaju od juna i preporuèena cena mu iznosi 899$.rnrn', 0, '2003-07-15 23:21:11', 5, 1); Now try MATCH (content) AGAINST ('Canon') I dont know I should get one result and Im not receiving any |
|
#4
|
|||
|
|||
|
RE: MATCH AGAINST problem
Ha ha,
I found it on your MySQL link: it says Note: you should add at least 3 rows to the table before you try to match anything, and what you're searching for should only be contained in one of the three rows. This is because of the 50% thereshold. If you insert only one row, then now matter what you search for, it is in 50% or more of the rows in the table, and therefore disregarded. I have only 2 rows thanks |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > MATCH AGAINST problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|