The search framework in ADAM has a small and little known feature that can
improve the search experience of your users. By default, the search framework
supports a whole bunch of operators like OR, AND, NOT, CONTAINS, =, >, <> and so
on. Next to that, there are also characters that give a keyword in search
expression a special meaning like an ampersand (@), a question mark (?), a dot
(.) and others.
These operators and special characters give you the developer, or the users using
your custom ADAM website, access to some of the advanced search functionality.
However, sometimes these features are overkill and hardly used by your users. In
this case, you can disable the search keywords that you don't want your users to
use. Once a keyword is disabled, it is treated by the search framework as any
other ordinary character and it looses its special meaning.
For example:
| C# |
1
2
3
4
|
SearchExpression expr = new SearchExpression("2009 not on the road");
expr.DisabledKeywords = DisabledKeyword.QuestionMark | DisabledKeyword.Dot |
DisabledKeyword.At | DisabledKeyword.Contains |
DisabledKeyword.Or | DisabledKeyword.Not;
|
The previous code sample creates a search expression that has the specified keywords disabled.
This ensures for example that your users don't have to quote the not they
specified in not on the road.