
The Advanced Advanced Find application shows how to make use of the "search rule" concept. This is one of the very few features that's available only in the API. For some reason, the out-of-the-box search dialog does not expose this feature.
Now that I have a sample out on this feature, I'd like to explain a bit more on how to use it. In the API there are 3 rule types: May, Must and MustNot. MustNot doesn't work, so I'll only focus on May and Must. In programming terms, I like to think of May and Must statements as OR and AND conditions respectively.
The Must (AND) behavior is what is exposed in the UI find dialog, and it's the behavior from versions earlier than 2011. The May (OR) behavior is new for Vault 2011. At least it is new at the Search Condition level.
It is possible to use the word "or" in the value of the search condition (see picture below). It does result in OR behavior, but that trick can only be used on a single property. The May rule is the only way to OR together different properties. 
Usage:
In order for the search to work properly, the following requirements must be met:
- The search contains at least 1 Must condition
- May conditions must have at least one other May condition. In other words, you can have 0 May conditions or more than 1 May conditions. If there is only 1 May condition, it is ignored.
Order of operations:
The order that the conditions are in does not matter. The reason is that all the May conditions are grouped together and OR'ed against each other. The result is then AND'ed to the Must statements.
For example, the collection of conditions { May X, Must Y, May Z} can be rewritten as (X or Z) and Y. Since everything is grouped together in this manner, the search conditions can be in any order.

Leave a Reply