Basic Field Expressions
A filter consists of one more field expressions combined with boolean operators — for example, AND, OR, and NOT — and other grouping operators. Each field expression specifies which field is searched and the field value being searched on. The field also has a particular type which dictates how the field value will be interpreted by Model Manager — see Field Types.
You write a field expression using an @-notation of the general form:
@<field-name>:<field-value>
with <field-name> equal to the name of one of the available fields in Table 3-1, and <field-value> the value being filtered on. Write, for example,
@title:busbar
to find all models whose title contain the word busbar. To match on several search words, enclose the words with parentheses. Write
@title:(electrical busbar)
to find all models whose title contain both the words electrical and busbar.
A space between two search words is automatically interpreted as a boolean AND in the Model Manager search syntax. The above is thus equivalent to:
@title:(electrical AND busbar)
Write
@title:(electrical OR busbar)
if you want to find all models whose title contain either electrical or busbar.
You may have noticed that spaces in the input field for a Text Field in The Filter Dialog Box are automatically replaced by a boolean OR in the corresponding Filter query preview. Select Match all terms under Options to change this to AND instead.
Field expressions can be written for other Field Types than a simple Text Field. Write
@lastModified:9/17/21
to find all models last modified on September 17, 2021 using a Date Field.
You can enter a custom filter query either directly in the search field in the Open, Select File, Select Model, and Model Manager windows, or apply it as a separate filter in The Applied Filters Toolbar by first clicking the Customize filter query button () from The Filter Dialog Box.
If you want to combine full text search with a custom filter query, write the former first. The following is valid:
electrical busbar @description:example
and matches on all models with a title, description, filename, or assigned tags containing the words electrical and busbar, and that has a description containing the word example. The following is not valid:
electrical @description:example busbar
and results in an error message.
Controlling Precedence Using Parentheses
A boolean AND takes precedence over a boolean OR in the Model Manager search syntax. The filter
@title:(electrical AND busbar OR tuning AND fork)
matches models whose title either contains both electrical and busbar, or whose title contain both tuning and fork. You can override this operator precedence with parentheses. Write
@title:(electrical AND (busbar OR tuning AND fork))
to match all models whose title contain electrical, and either the single word busbar or the two words tuning and fork.
Wildcard Matching
You can use an asterisk character as a wildcard symbol that matches on zero or more arbitrary characters. The filter:
@title:electric*
matches on all models whose title begin with electric.
You can match on all models that have any value set for a field by using a single wildcard symbol. Write
@description:*
to find all models with a nonempty description. This can also be written using the special ANY symbol:
@description:ANY
which may feel more intuitive.
You can use a wildcard symbol anywhere in a search word. Placing it at the start (that is, a postfix search) may, however, result in slow query times. The exception is when the field value only contains a single wildcard symbol, and nothing else.
Wildcard matching on search words that include punctuation markers —for example, periods, commas, colons, and hyphens — may lead to surprising results when used in a full text search or in a Text Field filter due to how the search splits text into word tokens. You are recommended to avoid using wildcards for such search words. A Keyword Field filter does not have this limitation.
Phrase Matching
You can match on phrases — that is, multiple words in a sequence — by enclosing them in quotation marks. Write
@title:”electrical heating”
to match on models whose title contains electrical followed by heating. You can also combine phrase search with ordinary search. Write
@title:(”electrical heating” busbar)
to match on models whose title contains electrical followed by heating, as well as the word busbar, for example, Electrical Heating in a Busbar.
Wildcard Matching inside a phrase is not supported.
Negated Matching
You can reverse the match logic using the special NOT symbol. Write
@title:(NOT busbar)
to find all models whose title does not contain the word busbar. The NOT symbol takes precedence over both AND and OR, although you can override this precedence with parentheses. Write
@title:(NOT (electrical busbar))
to find all models whose title does not contain the words electrical and busbar.
You can exclude the parentheses if the NOT is followed by a single word. Thus @title:NOT busbar is equivalent to the first example.
Range Matching
A filter on a Date Field and a Numeric Field can be written as inclusive ranges. Write
@lastModified:[9/1/21 TO 9/30/21]
to find all models last modified for the month of September in 2021. Use a wildcard symbol for unbounded ranges. The filter
@lastModified:[* TO 8/31/21]
matches on all models that have not been modified after August 2021.
Escaping Reserved Characters
Some characters serve special purposes in the Model Manager search syntax and are considered reserved characters. If you want to search on words that contain these characters, precede them by a backslash. Write
@tag:(\[In Progress\])
to match all models assigned the tag with title [In Progress]. The enclosing parentheses are necessary as there are two search words, [In and Progress].
The ten reserved characters are:
{ } ( ) [ ] " : \ SPACE
The last one is a common pitfall when writing a filter on a Keyword Field that matches a string containing a space character. Write
@filename:electrical\ heating\ busbar.mph
to match a model with filename electrical heating busbar.mph. Parentheses are not necessary here because the value is considered as one search word when escaping the two space characters.