Picking Property Restrictions
The section “Add property restrictions…” allows
for the ability to create strings of property restrictions from a
series of two drop-down boxes and a free text field. Using this option,
users can string together queries with several property restrictions
without learning how to enter them into the search box. Just like a
property restriction entered as query syntax, each property restriction
has three sections, which include the property name, the property
operator, and the value. When multiple property restrictions are built
into the advanced search, a fourth field, which allows for restrictions
to be combined using the AND operator or the OR operator, appears. To
add or remove additional property restrictions, simply select the + or
− icon to the far right of the property restriction.
The first drop-down after the phrase “Where the
property…” is labeled “(Pick Property)” and allows the user to choose
the property that will be restricted (Figure 4).
By default, the properties shown in the following figure are available
when searching all result types. Additional properties are made
available depending on the selected result type.
Figure 4. Pick Property options
The second drop-down allows the user to select
the operator to be used in the property restriction. Depending on the
selected property type, the available operators will change. If the
property is a text, or string, then the “Contains”, “Does not contain”,
“Equals”, and “Does not equal” operators will be available. If the
property is an integer, then “Equals”, “Does not equal”, “Greater
than”, and “Less than” operators are available. If the property is a
time or date, then the “Equals”, “Earlier than”, and “Later than”
operators become available. Table 2 lists the available operators and their corresponding symbol for use in search query syntax.
Table 2. Advanced Search Property Restriction Operators
Field Title |
Operator |
Contains: |
|
Does not contain |
< > |
Equals= |
|
Does not equal |
NOT |
Greater than |
> |
Less than |
< |
Earlier than |
<= |
Later than |
>= |
The last field is a free text field where the
user enters the desired value of the property restriction. Depending on
the property type, the values that will return results greatly differ.
Author, Description, Name, URL, Created by, and Last Modified By
property types will all accept text strings. The Size property type
will accept a numerical value in bytes by default. The Last Modified
Date property will accept a numerical date in the form DAY/MONTH/YEAR
or MONTH/DAY/YEAR depending on how the SharePoint 2010 DateTime field
is configured. This allows for flexibility in global deployments.
Query Examples on the Advanced Search Page
Some of the examples of property restrictions
found in the previous section on search query syntax can be found in
the following screens. Figure 5
provides an example of utilizing the author property with the equals
and OR operators. This search will return results with the authors Josh
Noble, Robert Piddocke, and Dan Bakmand Mikalski. This is equivalent to
the search query author:"Josh Noble" author:"Robert Piddocke" author:"Dan Bakmand Mikalski"
.
Figure 5. Configuring a query to return only items authored by Josh Noble, Robert Piddock, or Dan Bakmand Mikalski
The parameters in Figure 6
will return results for Word documents over 50MB (52,428,800 bytes)
authored by Josh Noble. This search is equivalent to the query author:"Josh Noble" AND filetype=docx AND size>50MB
.
Figure 6. Configuring a query to return only Word documents over 50MB authored by Josh Noble
The search in Figure 7
will return results for any English PowerPoint presentations, no matter
the extension, that contain the phrase “SharePoint Search Expert”. This
search is the equivalent of entering the query (DetectedLanguage="en")
(FileExtension="ppt" OR FileExtension="pptx" OR FileExtension="pptm" OR
FileExtension="odp") AND SharePoint Expert
.
Figure 7. Configuring a query to return only English PowerPoint presentations containing the phrase “SharePoint Expert”
For users that would like to learn the
available search query syntax and become less reliant on the Advanced
Search page, try this.
Build a search query in the Advanced Search
page. Make sure to include the property restrictions and keyword syntax
you would like to learn how to enter manually. Execute the search and
take note of the content produced in the search field at the top of the
search results page. Figure 8
shows an example of part of an advanced query syntax that would be
produced by specifying a scope, last modified date, and file extension
on the Advanced Search page.
Figure 8. Advanced search syntax after a query from the Advanced Search page
This search
syntax also contains all of the keywords, property, and scope
restrictions built into an advanced search query. This syntax can also
be entered into any SharePoint search field to reproduce the same
results. The syntax is also useful to learn the structure of search
strings, operators, and property restrictions. Taking note of this
syntax will guide your knowledge of the search syntax through
repetition. Eventually, you will not need to navigate to the Advanced
Search page for your commonly entered expressions.