When defining custom MacroView search masks you can utilise a number of out-of-the box controls, including text boxes, date/time, drop down and Yes / No.
By using the Enterprise Keyword or Search Taxonomy Controls you can also add controls that allow you to select valid values from a managed metadata term set. The Search Taxonomy Controls allow you to pick multiple values by typing ahead and / or by searching across the taxonomy. The selected (picked) values are then used in the search query that MacroView DMF generates to find documents and emails stored in SharePoint – either on-premises or Online.
There are two type of Search Taxonomy Controls available:
- TaxonomySearch - available in DMF and Message 8.5 or later.
- EnterpriseKeyword - available in DMF and Message 8.7.41 or later.
Taxonomy controls from MacroView DMF/Message 8.9.1468 and later
TaxonomySearch and EnterpriseKeyword search control
Definitions
There are five substitutes you can specify in the name attribute of a taxonomy search or enterprise search control:
- Managed Property Name (required)
- Term Store Id (required)
- Term Set Id (required)
- Term Set Location (optional, required if a match type is specified)
- Match Type (optional)
Managed Property Name (required)
This is the name of the managed search property.
Term Store Id (required)
The term store id is the unique Identifier for the Taxonomy term store in your tenant.
Important: always use the unique identifier for the tenant term store as the substitute for the termstoreid for all the different configuration scenarios outlined below.
Term Set Id (required)
The term set id is the unique Identifier for the term set in your tenant or site collection.
Term Set Location (optional, required if a match type is specified)
The term set location is used to specify whether the term set is located at the tenant or site collection level.
If the term set location is omitted then the location of term set is at the tenant level.
Tenant Level
If you specify an empty string or any text except a URL then the term set location is tenant level.
Site Collection Level
Enter the site collection URL to specify that the term set is located at the site collection level.
Match Type (optional)
The match type is used to specify if the search constraint is:
- OR
- AND
If no match type is specified then by default the search constraint is OR.
Defining a Taxonomy Search Control
The Name entry in the <control> section of the taxonomy control in your search mask requires 3, 4 or 5 parameters depending on:
- where the term set has been defined
- where the search managed property corresponding to the term set had been defined
- whether the search should return results that match ALL or ANY of the selected values.
The general syntax for defining the Taxonomy control is:
<Control Name="managedpropertyname|termstoreid|termsetid|termsetlocation|matchtype Type="control type" DisplayName="control label" />
e.g.
<Control Name="DocumentType|5abe6173b7384ced9ac40905921d3b94|f9222dba-de9f-429c-bd4f-18161f938f5f" Type="TaxonomySearch" DisplayName="Document Type" />
for example:
To display the Document Type managed metadata term set located at the tenant level.
<Control Name="DocumentType|5abe6173b7384ced9ac40905921d3b94|f9222dba-de9f-429c-bd4f-18161f938f5f" Type="TaxonomySearch" DisplayName="Document Type" />
To display the Document Type managed metadata term set located at the site collection level.
<Control Name="DocumentType|5abe6173b7384ced9ac40905921d3b94|f9222dba-de9f-429c-bd4f-18161f938f5f|https://yourtenancy.sharepoint.com/sites/sitename" Type="TaxonomySearch" DisplayName="DocumentType" />
To display the Document Type manage metadata term set located at the site collection level where only documents matching ALL of the selected values are to be returned.
<Control Name="DocumentType|5abe6173b7384ced9ac40905921d3b94|f9222dba-de9f-429c-bd4f-18161f938f5f|https://yourtenancy.sharepoint.com/sites/sitename|AND" Type="TaxonomySearch" DisplayName="DocumentType" />
To display the Document Type manage metadata term set located at the site collection level where documents matching ANY of the selected values are to be returned.
<Control Name="DocumentType|5abe6173b7384ced9ac40905921d3b94|f9222dba-de9f-429c-bd4f-18161f938f5f|https://yourtenancy.sharepoint.com/sites/sitename|OR" Type="TaxonomySearch" DisplayName="DocumentType" />
To display the Document Type manage metadata term set located at the tenancy level where only documents matching ALL of the selected values are to be returned.
<Control Name="DocumentType|5abe6173b7384ced9ac40905921d3b94|f9222dba-de9f-429c-bd4f-18161f938f5f|tenancy|AND" Type="TaxonomySearch" DisplayName="DocumentType" />
Note: The default match type for a multi value term set is OR meaning search results will be returned for documents that have ANY of the selected values unless the AND parameter is included.
Defining a Enterprise Keyword Control
The syntax for defining the EnterpriseKeyword control is:
<Control Name="managedpropertyname|termstoreid|termsetid|matchtype Type="control type" DisplayName="control label" />
e.g.
<Control Name="owstaxIdTaxKeyword|5abe6173b7384ced9ac40905921d3b94|f9222dba-de9f-429c-bd4f-18161f938f5f" Type="EnterpriseKeyword" DisplayName="Keyword" />
Matchtype is optional and defaults to OR meaning search results will be returned for documents that have ANY of the selected values unless the tenancy|AND parameter is included. e.g.
<Control Name="owstaxIdTaxKeyword|5abe6173b7384ced9ac40905921d3b94|f9222dba-de9f-429c-bd4f-18161f938f5f|tenancy|AND" Type="EnterpriseKeyword" DisplayName="Keyword" />
Important Note:
Advanced Configurations
Advanced configurations are possible where a term group id is specified in place of a term set id, however this requires that the managed search property is mapped to multiple crawled properties.
Taxonomy Picker (Legacy)
The TaxonomySearch control above replaces the previously available TaxonomyPicker control type that can be purchased separately. If you have existing search panels containing TaxonomyPicker controls these will still work and can be can be updated to TaxonomySearch controls simply by changing the control Type.
Optional TaxonomyPicker control
Tip: Contact services@macroview.com.au to purchase a license for the optional Taxonomy Picker control if required.
Related articles