Jump to content

search query problems


tidus97

Recommended Posts

hey guys. here is my mysql query to search for words:

 

$query = mysql_query("SELECT * FROM poll

WHERE match (choice1Txt,choice2Txt) against ('$inWord'); ");

 

this works, but it sucks horribly. the words it finds needs to be exact for example, (...which is good sometimes) and sometimes it just doesnt return anything, despite it existing in the DB.

 

in short, its a bit too strict to the point of not returning relavent results...

 

also, i have no way of returning only the most relevant results. but before this i have to get the correct results first.

 

 

any ideas..?

 

 

FYI - here is what i think the query means, just incase i understood wrong:

 

select all the rows from the poll table if the word we're searching for ('$inWord') matches that rows choice1Txt and choice2Txt field.

 

Link to comment
Share on other sites

  • 2 weeks later...

Of course it'll only match the word you've specified in the query.

i.e. you're looking for "dinosaur" it's only going to provide you with results that actually contain "dinosaur" NOT "dino", "dinos", "dinosaurs", etc

It's not a google searching algorithm you know... it doesn't provide synonyms for words.

 

n.b. there is a way to return results based on relevancy, so i recommend check the MySQL manual for it.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.