Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old August 3rd, 2003, 12:01 AM
ljuba ljuba is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 3 ljuba User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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?

Reply With Quote
  #2  
Old August 3rd, 2003, 12:46 AM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
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

Reply With Quote
  #3  
Old August 3rd, 2003, 10:41 AM
ljuba ljuba is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 3 ljuba User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #4  
Old August 3rd, 2003, 10:43 AM
ljuba ljuba is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 3 ljuba User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > MATCH AGAINST problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT