Yorkshire Divers

Deep Blue Technical
Go Back   YD Scuba Diving Forums > Non-Diving Related Forums > Technology
User Name
Password

Welcome to the YD Scuba forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

Technology: Discuss MySQL help in the Non-Diving Related Forums forums: I need a little help from all you MySQL gurus out there. I am setting up (yet another) web project ...

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 19-10-06, 09:00 AM
Jay's Avatar
Jay Jay is offline
Giggety Giggety
 

Join Date: Nov 2001
Location: Wakefield, West Yorkshire
Posts: 5,064
Jay is a scuba diver - cold waterJay is a scuba diver - cold waterJay is a scuba diver - cold waterJay is a scuba diver - cold waterJay is a scuba diver - cold waterJay is a scuba diver - cold waterJay is a scuba diver - cold waterJay is a scuba diver - cold waterJay is a scuba diver - cold waterJay is a scuba diver - cold waterJay is a scuba diver - cold water
MySQL help

I need a little help from all you MySQL gurus out there. I am setting up (yet another) web project and want to use fulltext searching for my form search. The statement I am using is as follows:

Code:
SELECT name,description,manufacturer,retailer,parent,department,link,imageThumb,imageLarge,price, MATCH(name) AGAINST ('$searchKeyword') AS RANK FROM stock ORDER BY RANK DESC LIMIT $searchLimit;
where $searchKeyword and $searchLimit are variables passed through the function that calls the search.

HOWEVER, I only want to return items that score more than 0 on rank (search weighting) as other results are non applicable. HOw do I use FULLTEXT to return only those results?

One option I thought of was to explode the keyphrase and add '+' onto the front of each keyword in the keyphrase and then searching in BOOLEAN mode but surely there must be a simpler answer.
__________________
Old divers never die - they just go down on old wrecks.

Jay


Golf Clubs Direct - Replica Football Shirts - MP3 World - MP3 Revolution - Some of my other ventures!
________________________________________
Future Music Internet Radio is currently http://wms3.global-streaming.net/sc_...ize=88&scid=18

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 19-10-06, 09:40 AM
Conor's Avatar
Ginger, Irish, sometimes stroppy
 

Join Date: Jun 2003
Location: Royston (Herts)
Posts: 5,995
Conor swims in cold waterConor swims in cold waterConor swims in cold waterConor swims in cold waterConor swims in cold waterConor swims in cold waterConor swims in cold waterConor swims in cold waterConor swims in cold waterConor swims in cold waterConor swims in cold water
I'm just going to have a look, but the quick impression is why can't you concatenate '+' onto the variable in the select?

Sorry I'm more on the Ora side of things
__________________
“Did I leave the gas on? No! No, I'm a f***in' squirrel!”

Mr E Izzard
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 19-10-06, 09:43 AM
Conor's Avatar
Ginger, Irish, sometimes stroppy
 

Join Date: Jun 2003
Location: Royston (Herts)
Posts: 5,995
Conor swims in cold waterConor swims in cold waterConor swims in cold waterConor swims in cold waterConor swims in cold waterConor swims in cold waterConor swims in cold waterConor swims in cold waterConor swims in cold waterConor swims in cold waterConor swims in cold water
Alternatively can't you use the same syntax in the where?

i.e.

select match(blah) against(blah) as rank
where match(blah) against(blah > 0
order by Rank
__________________
“Did I leave the gas on? No! No, I'm a f***in' squirrel!”

Mr E Izzard
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 19-10-06, 09:54 AM
Jay's Avatar
Jay Jay is offline
Giggety Giggety
 

Join Date: Nov 2001
Location: Wakefield, West Yorkshire
Posts: 5,064
Jay is a scuba diver - cold waterJay is a scuba diver - cold waterJay is a scuba diver - cold waterJay is a scuba diver - cold waterJay is a scuba diver - cold waterJay is a scuba diver - cold waterJay is a scuba diver - cold waterJay is a scuba diver - cold waterJay is a scuba diver - cold waterJay is a scuba diver - cold waterJay is a scuba diver - cold water
Quote:
Originally Posted by Conor
Alternatively can't you use the same syntax in the where?

i.e.

select match(blah) against(blah) as rank
where match(blah) against(blah > 0
order by Rank
That works Conor - thanks. Having read it, its obvious but it wasn't at 11.45pm last night after a 17 hour day
__________________
Old divers never die - they just go down on old wrecks.

Jay


Golf Clubs Direct - Replica Football Shirts - MP3 World - MP3 Revolution - Some of my other ventures!
________________________________________
Future Music Internet Radio is currently http://wms3.global-streaming.net/sc_...ize=88&scid=18

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 19-10-06, 09:57 AM
Conor's Avatar
Ginger, Irish, sometimes stroppy
 

Join Date: Jun 2003
Location: Royston (Herts)
Posts: 5,995
Conor swims in cold waterConor swims in cold waterConor swims in cold waterConor swims in cold waterConor swims in cold waterConor swims in cold waterConor swims in cold waterConor swims in cold waterConor swims in cold waterConor swims in cold waterConor swims in cold water
I can imagine. Although I haven't worked a 17 hour day in year....and if I did, the last thing I'd want to do is look at a Db
__________________
“Did I leave the gas on? No! No, I'm a f***in' squirrel!”

Mr E Izzard
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


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

vB 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

Yorkshire Divers - RSS Feed
All times are GMT +1. The time now is 06:58 AM.
Powered by vBulletin
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Trademark and all rights reserved : © YD.com Ltd (2006)
YD.com Ltd (Registered in England - 05886696)
Other sites : Golf Clubs | New Premiership Football Kits | MP3 Portable Players | MP3 Players For Sale | Replica Football Kits | Cheap Football Boots

Forums Directory