Search Filtering using a Dropdownlist

chazlink

New member
Joined
Mar 7, 2007
Messages
1
Programming Experience
Beginner
Hello all -

This is my first post and I thank all of you for any time and help that you may be able to offer.

I am currently designing a .NET page that searches a Microsoft Index Service catalog, and I have gotten it to work beautifully. However, my employer wants the search to be able to be filtered based on certain criteria, for example, by category. So what I did was create a folder for each category, and what I want to do is based on the Item a user chooses from a Dropdownlist (which is a list of the various categories), limit the scope() of the search to that folder.

I understand how to do everything, including limiting the scope, but I am not sure about the logic.

I assume that it should be something like the following:
VB.NET:
[SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2] (category.SelectedValue=[/SIZE][SIZE=2][COLOR=#800000]"Football Teams"[/COLOR][/SIZE][SIZE=2]) [/SIZE]
[SIZE=2][/SIZE] 
[SIZE=2]THEN cmdSearch.CommandText = [/SIZE][SIZE=2][COLOR=#800000]"select doctitle, filename, vpath, rank, characterization FROM SCOPE('deep traversal of "[/COLOR][/SIZE][SIZE=2]/Football Teams[/SIZE][SIZE=2][COLOR=#800000]" ') [/COLOR][/SIZE]
[SIZE=2][COLOR=#800000]where FREETEXT(Contents, '"[/COLOR][/SIZE][SIZE=2]+ searchText +[/SIZE][SIZE=2][COLOR=#800000]"') order by rank desc"[/COLOR][/SIZE]
 
[SIZE=2]blah, blah, blah, execute the search.[/SIZE]

Then another IF statement for the next category, and so on.

Am I on the right path? Any help would be greatly appreciated. Thank you to any and all that could shed some light on this.

Also, I feel like I have searched for this topic ad naseaum on google and this site to no avail, but if there is a quick tutorial someone can point me toward, that would be greatly appreciated as well!!
 
Back
Top