
Search mask 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
- 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.
TrimDuplicates is defined in the <Mask> tag as follow:
Word Stemming
The ‘EnableStemming’ option in MacroView DMF 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">
Defining the panel 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:
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 DMF and Message 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" /> |
TaxonomySearch or TaxonomyPicker <Control Name="mvExample|5abwe60637384ced9ac46109921d3b94|f9552dba-de9a-429c-bd4f-18192f848f5f|https://yourtenancy.sharepoint.com/sites/sitecollection|AND" Type="TaxonomyPicker" DisplayName="Taxonomy" /> For more information and samples refer to Search Panel controls: Enterprise Keyword and Taxonomy Search |
EnterpriseKeyword (DMF and Message 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" /> |
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 |
Comments
0 comments
Article is closed for comments.