Search Mask Definition
Example Search Mask XML definition
<?xml version="1.0" encoding="utf-8" ?>
<SearchMasks>
<Mask Name="Email Search" TrimDuplicates="False" EnableStemming="True" Scope="All Sites" >
<Controls>
<Control Name="mvTo" Type="Text" DisplayName="To" />
<Control Name="mvFrom" Type="Text" DisplayName="From" />
<Control Name="mvSubject" Type="Text" DisplayName="Subject" />
<Control Name="mvImportance" Type="Dropdown" DisplayName="Importance" >
<Item DisplayName="Low" Value="0" />
<Item DisplayName="Normal" Value="1" />
<Item DisplayName="High" Value="2" />
</Control>
<Control Name="FileExtension" Type="Hidden" Value="msg" />
<Control Name="mvReceivedTime" Type="DateRange" DisplayName="Received Time" />
<Control Name="mvHasAttachments" Type="Checkbox" DisplayName="Has attachments?" Value="0" />
<Control Name="AllText" Type="Text" DisplayName="All of these words" SearchPredicate="FreeText" />
<Control Name="mvCheckoutUser" Type="Checkbox" DisplayName="Checked out to me" Value="[Me]"/>
</Controls>
<SelectFields>
<Field Name="mvSubject" DisplayName="Subject" />
<Field Name="mvTo" DisplayName="To" />
<Field Name="mvFrom" DisplayName="From" />
<Field Name="mvReceivedTime" DisplayName="Received Time" Type="DateTime"/>
<Field Name="Path" DisplayName="Url"/>
<Field Name="SiteName" />
</SelectFields>
</Mask>
</SearchMasks>
Understanding the Search Mask definition
- Panel name and scope definition
- Panel controls
-
Section headings
- Result columns
- Refiners (optional)
Defining the panel name and scope
Panel name
Search scope
Using a search scope
Using a result source
Using term sets defined at the site collection
Where clause
Note: The asterisk at the end of the path in the Where clause is required.
Duplicate Trimming
TrimDuplicates is defined in the <Mask> tag as follow:
Word Stemming
The ‘EnableStemming’ option in MacroView DMS Pro search panels specifies whether the SharePoint search should use word stemming. Stemming is a process where the endings of some words are stripped off to facilitate a search that returns results including related words, such as ‘kick’, ‘kicks’ ‘kicking’, ‘kicked’ etc. The default behavior in the SharePoint UI is for stemming to be disabled. The default behavior in MacroView panels is for stemming to be enabled. You can modify your search panel XML definition if you would like to match the browser search.
EnableStemming is defined in the <Mask> tag as follow:
<Mask Name="Email Search" TrimDuplicates="False" EnableStemming="True">
Controls
In the above email search panel example, a text control labelled “To” is defined and associated with the managed property “mvTo” as illustrated here:
Available control types:
Text <Control Name="mvSubject" Type="Text" DisplayName="Subject" /> |
Dropdown <Control Name="mvImportance" Type="Dropdown" DisplayName="Importance" > For more information and samples refer to Using the DropDown control in search panels |
DateRange <Control Name="mvReceivedTime" Type="DateRange" DisplayName="Received Time" /> Or to include time. <Control Name="mvReceivedTime" Type="DateRange" DisplayName="Received Time" ShowTime="1" /> The ShowTime parameter is only available in MacroView DMS and DMS Pro 8.8.74 and later. When ShowTime is not present or is set to 0 the date range specified is assumed to be 12:00 AM on the date in the top control and 12:00 AM on the day following the date on the bottom control. |
Checkbox <Control Name="mvHasAttachments" Type="Checkbox" DisplayName="Has attachments?" Value="0" /> <Control Name="mvManager" Type="Checkbox" DisplayName="Manager" Value="[Me]" /> |
TaxonomySearch or TaxonomyPicker <Control Name="mvExample|5abwe60637384ced9ac46109921d3b94|f9552dba-de9a-429c-bd4f-18192f848f5f|https://yourtenancy.sharepoint.com/sites/sitecollection|AND" Type="TaxonomySearch" DisplayName="Taxonomy" /> For more information and samples refer to Search Panel controls: Enterprise Keyword and Taxonomy Search |
EnterpriseKeyword (DMS and DMS Pro 8.7 or later) <Control Name="owstaxIdTaxKeyword|5abwe60637384ced9ac46109921d3b94|f9552dba-de9a-429c-bd4f-18192f848f5f" Type="EnterpriseKeyword" DisplayName="Keyword" /> For more information and samples refer to Search Panel controls: Enterprise Keyword and Taxonomy Search |
Hidden By setting Type="Hidden" in a search mask control you can hide the control from users. <Control Name="FileExtension" Type="Hidden" Value="msg" /> In the above example, a hidden control is used to define Email messages as files that have a file extension of ‘msg’. You might also use a hidden control type as another way of limiting the results by defining a Value for it to filter results on. <Control Name="mvClient" DisplayName="Client" Type="Hidden" Value="Acme" /> |
Other optional control parameters include:
MatchType <Control Name="AllText" Type="Text" DisplayName="All of these words" SearchPredicate="FreeText" MatchType="AllText" />
<Control Name="Exact" Type="Text" DisplayName="The exact phrase" SearchPredicate="FreeText" MatchType="Exact"/>
<Control Name="AnyText" Type="Text" DisplayName="Any of these words" SearchPredicate="FreeText" MatchType="AnyText"/>
<Control Name="None" Type="Text" DisplayName="None of these words" SearchPredicate="FreeText" MatchType="None"/>
|
SearchPredicate <Control Name="AllText" Type="Text" DisplayName="Any of these words" SearchPredicate="FreeText" /> |
AdvancedBooleanSearch By setting Type="AdvancedBooleanSearch" in a search mask control you can submit any KQL directly. <Control Name="AdvancedSearch" DisplayName="Advanced Search" Type="AdvancedBooleanSearch" Value="mvClient:Acme" /> For more information refer to Using the "Advanced" control in search masks to submit KQL directly |
[Me] placeholder for Author columns From MacroView DMS/DMS Pro and later for SharePoint online and lite servers. "mvCheckoutUser" or "mvMyDocument" can be substituted for values such as mvDocumentAuthor, mvMatterManagedBy, mvProjectManagedBy or mvManagedBy. Standard
<Control Name="mvCheckoutUser" Type="Checkbox" DisplayName="Checked out to me" Value="[Me]"/><Control Name="mvMyDocument" DisplayName="My Document" Type="Checkbox" SearchPredicate="Contains" Value="[Me]"/> New <Control Name="mvDocumentAuthor" Type="Checkbox" DisplayName="Checked out to me" Value="[Me]"/> |
Section text header control
In DMS 9.2 and later, you can add text headings to organise and group your search panel controls.
<Control Type="TextHeader" DisplayName="Additional Search Options"/>
Result Field Columns
<SelectFields>
<Field Name="FileName" DisplayName="Name" />
<Field Name="Author" DisplayName="Author" />
<Field Name="HitHighlightedSummary" DisplayName="Summary" />
<Field Name="Path" DisplayName="Url"/>
<Field Name="Write" DisplayName="Modified" />
<Field Name="SiteName" />
<Field Name="UIVersionStringOWSTEXT" DisplayName="Version"/>
<Field Name="SPVersion" DisplayName="SPVersion"/>
<Field Name="SPWebUrl" DisplayName="SPWebUrl"/>
<Field Name="WebUrl" DisplayName="WebUrl"/>
<Field Name="ListId" DisplayName="ListId"/>
<Field name="Created" DisplayName="Created" Type="DateTime"/>
<Field name="Size" DisplayName="Size" Type="Size"/>
</SelectFields>
Datetime field type
File size field type
Hit Highlighted Summary
<Field Name="HitHighlightedSummary" DisplayName="Summary" />
Standard SharePoint search properties
See the Microsoft article below for a full list of standard crawled properties.
Sorting results using Number type fields
<Field Name="Size" DisplayName="Size" Type="Number"/>
Refiners
<Refiners>
<Refiner name="Size" displaytext="Size" />
<Refiner name="FileType" displaytext="Result Type" />
</Refiners>