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
https://forums.phpfreaks.com/topic/141933-search-query-problems/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.