Irish SEO,  Marketing & Webmaster Discussion

 

Full text search returns an empty string, can't understand

This is a discussion on Full text search returns an empty string, can't understand within the Coding Help forums, part of the Webmaster Help category; Hello, I have an sql search with data in a table which should be returned. However the I am getting ...


Go Back   Irish SEO, Marketing & Webmaster Discussion > Webmaster Help > Coding Help

Register Forum Rules FAQDonate Calendar Search Today's Posts Mark Forums Read

  #1 (permalink)  
Old 14-04-2008, 10:32 AM
Coder
 
Join Date: Jan 2007
Location: Navan, Co Meath
Posts: 60
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
oliflorence will become famous soon enough
Default Full text search returns an empty string, can't understand

Hello,
I have an sql search with data in a table which should be returned. However the I am getting an empty set back.
I enclose below the SQL I am using and the table:

Code:
SELECT poisonId, poison, latin_name, short_desc, status FROM tblpoisons WHERE MATCH (poison,latin_name,short_desc,full_desc) AGAINST ('%poison%')
Here is the table:
Code:
CREATE TABLE `tblpoisons` ( `poisonId` int(11) NOT NULL auto_increment, `catId` int(11) default NULL, `poison` varchar(150) default NULL, `latin_name` varchar(150) default NULL, `short_desc` varchar(250) default NULL, `Full_desc` mediumtext, `status` tinyint(1) default NULL, PRIMARY KEY (`poisonId`), FULLTEXT KEY `searchindex` (`poison`,`latin_name`,`short_desc`,`Full_desc`)) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
Many thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 14-04-2008, 10:58 AM
Briask's Avatar
Wannabe Geek
 
Join Date: Feb 2008
Location: Dublin
Posts: 148
Nominated 1 Time in 1 Post
TOTW/F/M Award(s): 0
Briask will become famous soon enough
Default

Have you inserted any data in the table?

The SQL you included creates an empty table.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 14-04-2008, 11:46 AM
Coder
 
Join Date: Jan 2007
Location: Navan, Co Meath
Posts: 60
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
oliflorence will become famous soon enough
Default

Yes there is data added, it should return some data as the word searched is included in the fields
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 14-04-2008, 12:05 PM
ziycon's Avatar
Wannabe Geek
 
Join Date: Jan 2007
Location: Dublin
Posts: 427
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
ziycon will become famous soon enough
Send a message via MSN to ziycon
Default

Maybe try a LIKE statement??
__________________
Irish Gaming Network
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 14-04-2008, 12:37 PM
Briask's Avatar
Wannabe Geek
 
Join Date: Feb 2008
Location: Dublin
Posts: 148
Nominated 1 Time in 1 Post
TOTW/F/M Award(s): 0
Briask will become famous soon enough
Default

You need to add more rows to the table or change the query.

MySQl has a 50% threshold on the Match Against construct meaning that if your query matches more than 50% of the rows in the table it does not consider the match relevant so it does not return the rows.

So you add more rows without the text you are querying for and you'll get results ...

Or you can use the "In boolean mode" by changing your query to
Code:
SELECT poisonId, poison, latin_name, short_desc, status 
FROM tblpoisons
WHERE MATCH (poison,latin_name,short_desc,full_desc) 
AGAINST ('%poison%' in boolean mode)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
empty, full, returns, search, string, text, understand

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Sponsored links

Pepperjam Network
Paid On Results www.zanox.com


All times are GMT +1. The time now is 06:41 PM.


Powered by: vBulletin Version 3.8.2, Copyright ©2000 - 2009, Jelsoft Enterprises Limited.
Hosted in Ireland by Blacknight - Test your ISP |Irish Hosting Directory| Armchair.ie|Logo by Eden Web Design|Avatars by Afterglow |Latest Blog Entries | VPS HostingAd Management by RedTyger

Search Engine Friendly URLs by vBSEO 3.3.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51