Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FULLTEXT query doesn't wanna get any results?

Status
Not open for further replies.

youradds

Programmer
Jun 27, 2001
817
GB
Hi,

This is driving me up the wall. I bet its something stupidly simple - but I'm not seeing it :(

Code:
SELECT * , MATCH (Keywords) AGAINST ('mascot') AS score
FROM glinks_Links
WHERE  MATCH (Keywords) AGAINST ('mascot')
ORDER BY score
LIMIT 25

...yet it gives no results. Here is an example of the values held in "Keywords" (which *is* a FULLTEXT field);

Code:
mascot design logo heart swords
horse horses vector vinyl-ready prance
mascot design logo cardinal
horse horses vector vinyl-ready head
mascot design logo flower of life
horse horses vector vinyl-ready prance
mascot design logo seal crest
horse horses vector vinyl-ready running
horse horses vector vinyl-ready sitting
mascot design logo hawk

Quite a few of those should come back as results (As they have "mascot" in the keywords... yet no results are being reported (no error, just 0 rows).... any ideas?

TIA

Andy
 
Mmm still having fun and games with this :(

SQL:
SELECT Title,Keywords,Description,MATCH(Keywords,Title,Description) AGAINST ('+mascot +logo') AS score
FROM glinks_Links
WHERE 
MATCH (Keywords,Title,Description) AGAINST ('+mascot +logo' IN BOOLEAN MODE)
LIMIT 25
...gives me results... but score is ALWAYS 0 :/

The results don't have to have ALL those words in... for example, a listing with "mascot" in the Keywords field, and "mascot" AND "logo" in the Title field, should still match. It seems at the moment that it keeps wanting them to exist in ALL the FULLTEXT fields, which is no good :(

TIA

Andy
 
Hi,

Thanks for the reply :) There are only 10 records in there ATM (just sample data). Probably 4 or 5 of them match the criteria in some way or another (some have some of the keywords in "title", others in "keywords", others in both... but they don't all necessarily have them in ALL the fields)

Cheers

Andy
 
there's your problem, then

find the spot in the manual talking about how fulltext searches sometimes give bizarre results if there are only a few rows in the table

r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
 
Aaaah ok - thanks ... will work on adding some more sample data :)

(we are gonna have a look at using Solr/Lucine for the searches, as I've used it in past projects to very good effect, but its a bugger to configure!)

Thanks again

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top