This topic is locked

More Advanced Search Option

8/25/2006 10:41:51 PM
ASPRunner.NET General questions
J
jgrunstra author

Please help! How do I make the search more advanced? Example in the search field if I type in BLUE GREEN if will only give me records with BLUE GREEN but not records that contain BLUE BLACK GREEN records. I want the search to find any word in the search field.

Eugene 8/28/2006

You can change WhereOneField function in file search.aspx.cs (or search.aspx.vb)
For example:

old code:

case "Contains":

sReturn = sSearchType + "(" + SearchField + ") like '%" + sValue + "%'";
new code:

case "Contains":

sReturn = "CONTAINS(" + SearchField + ", "+Value+")";
Where sValue should be: '"BLUE" OR "GREEN"'