Page 1 of 1

Tutorial for creating a 'search engine' with multiple words

Posted: Wed Oct 13, 2010 4:43 pm
by defroster
Hello,

Does anyone know a tutorial I can follow to create my own search engine over the items I have in my SQL database?
I find a lot of tutorials but they are all 'one word searches' which means if you type two words you will get all results that contain either word (too many hits).

If the search engine tutorial displays result with AJAX even better.

Thanks for help.
df

Re: Tutorial for creating a 'search engine' with multiple wo

Posted: Wed Oct 13, 2010 4:51 pm
by John Cartwright
To make similiary comparison of a string, you could use Fulltext Matches.

Otherwise, if you simply want to match any of the words against a database, then you would split the words by space, and add or

OR searchable_field LIKE '%$search world%'

which is basically a wildcard search (terribly innefficent and does not make use of indexes).

That is why Fulltext searching is recommended.