Problem in searching multiple keywords
hi, good day.
i have some problem in doing the searching multiple keywords function.
in my layout i have a textbox,user can insert many keywords with the comma separator between each keywords. and then the search function will go to search 3 field in table A, let say field 1 ,field 2 and field 3 see whether got match the keywords or not.
table A
ID |field 1 | field 2 | field 3
----------------------------------------------------------------------------
1 |air conditioner |air conditioner,free| air conditioner
2 | chair | chair,furniture | chair,furniture
3 | hair | hair,human,body | hair,human,body
4 | dog | animal,dog | animal,dog
5 | cat | animal,cat | animal,cat
ok. let say i insert keywords such as --> " AIR,DOG,Animal " in the textbox and search it.
so based on the records from my table. it should query out the records : which ID = 1,4,5(Air Conditioner,Dog and cat)
it should not display the result for Chair OR hair even these two words combine with AIR tis word (Ch +Air) & (H +Air).
the record Cat will show out becoz in the field 2 the "Animal" keywords is matched. therefore it will show out.
so the final result it will display Air conditioner, dog and cat
do u all get wat i mean?
i hope can get some response from u all soon. i need some help on coding.plz help.thanx alot.
P/s : i m using ASP with MS SQL Server 2005
|