List:General Discussion« Previous MessageNext Message »
From:James Taylor Date:May 8 2002 7:34pm
Subject:Basic Search Engine
View as plain text  
Not sure how to do something like this, but, I have a table that has 
sort of a "dictionary". I need to be able to search through the 
definitions with sort of a basic search engine functionality.  I'm 
planning on doing this with either perl or php, haven't decided.  That's 
not the problem though - How this should work is that there's a form 
field where a person can type in a few keywords.

Say the person types in "candy coated clown".  It will split the words 
separately and search for each individual work.  Put very simply it 
would be something like

select * from table where keyword like '%candy%' or keyword like 
'%coated%' or keyword like '%clown%'


That would work just fine, though I need to figure out if there's a way 
to do this sorted by relevancy.  If a match is made and contains all 3 
words, it should be listed first.  Two matches listed beneath that, 1 
match beneath that... Any ideas on how to do this through SQL, or would 
I have to build in some sort of logic into my script to determine this?

Thanks!

Thread
Basic Search EngineJames Taylor8 May
  • RE: Basic Search EngineGurhan Ozen8 May
  • Re: Basic Search EngineKevin Old9 May