Page 1 of 1

help me for implementing search functionality in website.

Posted: Mon Mar 29, 2010 5:23 am
by learnerabn
Hi
I'm involved in developing a website for a e-shopping company.
i want to include a search functionality in the site.
search should not be like google search for web pages.
if the user enter a string it should search the database for the match with product name or manufacturer name from a single table(lengthy table).
it should match the misspelled words also.
i searched the net for this but i cant get the appropriate method can any one help me?
Thanks in advance.

Re: help me for implementing search functionality in website

Posted: Mon Mar 29, 2010 6:18 am
by heren
hi,
you are taking the data's from the database right, then why can't u use %search_keyword% in the query for what all fields you are searching for ?

eg: select * from products where name like '%search_keyword%' or category like '%search_keyword%'

Re: help me for implementing search functionality in website

Posted: Mon Mar 29, 2010 10:54 am
by omniuni
If you want to include results form multiple columns, you can combine them using the "union" operator.

Re: help me for implementing search functionality in website

Posted: Tue Mar 30, 2010 2:41 pm
by learnerabn
First thanks for your reply heren and omniuni......
I have done those things already and got the results....
but i have to sort the results in the order "for example if the search key word have 3 strings then the result that matches all the 3 string first and then for two and at last for one"
and the another thing i have to match for misspelled words...
can you help me guys...