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.
help me for implementing search functionality in website.
Moderator: General Moderators
-
learnerabn
- Forum Commoner
- Posts: 48
- Joined: Wed Feb 10, 2010 12:56 am
Re: help me for implementing search functionality in website
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%'
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
If you want to include results form multiple columns, you can combine them using the "union" operator.
-
learnerabn
- Forum Commoner
- Posts: 48
- Joined: Wed Feb 10, 2010 12:56 am
Re: help me for implementing search functionality in website
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...
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...