Scenario
Crawled properties are not created by the search crawler for Taxonomy type fields provisioned using XML and CSOM.
You create Managed Metadata site columns using the XML field schema and the CSOM remote API, as you probably know, for Taxonomy type fields there are 2 site columns involved;
- The Taxonomy field type (single/multi-value)
- An accompanying Note type field
The typical XML field definitions for such a field is shown below;
<Field CanToggleHidden="TRUE" DisplayName="ClientName_0" Hidden="TRUE" ID="{99fc660e-b478-458f-9f55-59b75e60e4d8}" Name="ClientName_0" Required="FALSE" ShowInViewForms="FALSE" StaticName="ClientName_0" Type="Note" /> <Field DisplayName="Client Name" EnforceUniqueValues="FALSE" Group="Custom" ID="{a9eba363-fe7d-4fdf-8e00-c5fcfba12dd2}" Name="ClientName" Required="TRUE" ShowField="Term1033" StaticName="ClientName" Type="TaxonomyFieldType"> <Default/> <Customization> <ArrayOfProperty> <Property> <Name>SspId</Name> <Value p4:type="q1:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance" xmlns:q1="http://www.w3.org/2001/XMLSchema">41cd106d-7365-4f94-a372-d14fe9fd67fa </Value> </Property> <Property> <Name>GroupId</Name> </Property> <Property> <Name>TermSetId</Name> <Value p4:type="q2:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance" xmlns:q2="http://www.w3.org/2001/XMLSchema">18be237b-3da8-4232-b682-db96a4bee3f4 </Value> </Property> <Property> <Name>AnchorId</Name> <Value p4:type="q3:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance" xmlns:q3="http://www.w3.org/2001/XMLSchema">0f9d579b-7d91-4508-a8a8-15f7847eacfe </Value> </Property> <Property> <Name>UserCreated</Name> <Value p4:type="q4:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance" xmlns:q4="http://www.w3.org/2001/XMLSchema">false </Value> </Property> <Property> <Name>Open</Name> <Value p4:type="q5:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance" xmlns:q5="http://www.w3.org/2001/XMLSchema">false </Value> </Property> <Property> <Name>TextField</Name> <Value p4:type="q6:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance" xmlns:q6="http://www.w3.org/2001/XMLSchema">{99fc660e-b478-458f-9f55-59b75e60e4d8} </Value> </Property> <Property> <Name>IsPathRendered</Name> <Value p4:type="q7:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance" xmlns:q7="http://www.w3.org/2001/XMLSchema">false </Value> </Property> <Property> <Name>IsKeyword</Name> <Value p4:type="q8:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance" xmlns:q8="http://www.w3.org/2001/XMLSchema">false </Value> </Property> <Property> <Name>TargetTemplate</Name> </Property> <Property> <Name>CreateValuesInEditForm</Name> <Value p4:type="q9:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance" xmlns:q9="http://www.w3.org/2001/XMLSchema">false </Value> </Property> <Property> <Name>FilterAssemblyStrongName</Name> <Value p4:type="q10:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance" xmlns:q10="http://www.w3.org/2001/XMLSchema">Microsoft.SharePoint.Taxonomy, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c </Value> </Property> <Property> <Name>FilterClassName</Name> <Value p4:type="q11:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance" xmlns:q11="http://www.w3.org/2001/XMLSchema">Microsoft.SharePoint.Taxonomy.TaxonomyField </Value> </Property> <Property> <Name>FilterMethodName</Name> <Value p4:type="q12:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance" xmlns:q12="http://www.w3.org/2001/XMLSchema">GetFilteringHtml </Value> </Property> <Property> <Name>FilterJavascriptProperty</Name> <Value p4:type="q13:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance" xmlns:q13="http://www.w3.org/2001/XMLSchema">FilteringJavascript </Value> </Property> </ArrayOfProperty> </Customization> </Field>
You can see the associated Note field (Client_0) is created before the Taxonomy field and has the name Client_0.
After these fields are created on a site, added to a content-type, added to a library/list and content added and the content is indexed by search, there should be 2 crawled properties;
- ows_ClientName – contains the text term label(s)
- ows_taxid_ClientName – contains an array of term id data (see Data format for Managed Metadata @ https://technet.microsoft.com/en-us/library/jj613136.aspx)
These 2 crawled properties are not created, however these site columns do exist and can be used perfectly well as site columns on a list or library.
The problem seems to be in the naming convention used to name the Taxonomy fields accompanying Note type field. Although it shouldn’t matter, and there is no official documentation I’ve come across to confirm or refute this.
A further complicating factor, unconfirmed, seems to be also that the GUID Id’s used to reference the fields are better lowercase rather than uppercase.
Solution
There are 2 changes to make which seem to cause Taxonomy fields to be correctly crawled by search;
- The accompanying Note type field should have a suffix of TaxHTField
- The field GUID ID’s should be lower case not uppercase
The field definitions (for both single-value and multi-value) Taxonomy fields I’ve used recently, which work correctly as site columns and which get indexed correctly by search can be seen below;
<Field ID="{50cc3df8-5c25-48ef-924e-3816c9830a58}" Type="Note" Name="polDocumentTaggingTaxHTField" StaticName="polDocumentTaggingTaxHTField" DisplayName="polDocumentTaggingTaxHTField" Group="Custom" ShowInViewForms="FALSE" Required="FALSE" Hidden="TRUE" CanToggleHidden="TRUE" /> <Field ID="{9c2aa187-0834-4cea-aa4a-40e7e8e439d4}" Type="TaxonomyFieldTypeMulti" Name="polDocumentTagging" StaticName="polDocumentTagging" DisplayName="Document Tagging" Group="Custom" ShowField="Term1033" Required="FALSE" EnforceUniqueValues="FALSE" Mult="TRUE"> <Default></Default> <Customization> <ArrayOfProperty> <Property> <Name>SspId</Name> <Value xmlns:q1="http://www.w3.org/2001/XMLSchema" p4:type="q1:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">{sitecollectiontermstoreid} </Value> </Property> <Property> <Name>TermSetId</Name> <Value xmlns:q2="http://www.w3.org/2001/XMLSchema" p4:type="q2:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">18601470-759c-4658-87c6-a1e489700673 </Value> </Property> <Property> <Name>TextField</Name> <Value xmlns:q6="http://www.w3.org/2001/XMLSchema" p4:type="q6:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">{50cc3df8-5c25-48ef-924e-3816c9830a58} </Value> </Property> <Property> <Name>AnchorId</Name> <Value xmlns:q3="http://www.w3.org/2001/XMLSchema" p4:type="q3:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">00000000-0000-0000-0000-000000000000 </Value> </Property> <Property> <Name>IsPathRendered</Name> <Value xmlns:q7="http://www.w3.org/2001/XMLSchema" p4:type="q7:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">false </Value> </Property> <Property> <Name>IsKeyword</Name> <Value xmlns:q8="http://www.w3.org/2001/XMLSchema" p4:type="q8:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">false </Value> </Property> </ArrayOfProperty> </Customization> </Field> <Field ID="{766e0ffd-9bf4-433d-8c13-3d3e4b852ead}" Type="Note" Name="polDocumentTagTaxHTField" StaticName="polDocumentTagTaxHTField" DisplayName="polDocumentTagTaxHTField" Group="Custom" ShowInViewForms="FALSE" Required="FALSE" Hidden="TRUE" CanToggleHidden="TRUE" /> <Field ID="{990c32aa-fd36-4a03-a86c-9989c019e24b}" Type="TaxonomyFieldType" Name="polDocumentTag" StaticName="polDocumentTag" DisplayName="Document Tag" Group="Custom" ShowField="Term1033" Required="FALSE" EnforceUniqueValues="FALSE" Mult="FALSE"> <Default></Default> <Customization> <ArrayOfProperty> <Property> <Name>SspId</Name> <Value xmlns:q1="http://www.w3.org/2001/XMLSchema" p4:type="q1:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">{sitecollectiontermstoreid} </Value> </Property> <Property> <Name>TermSetId</Name> <Value xmlns:q2="http://www.w3.org/2001/XMLSchema" p4:type="q2:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">18601470-759c-4658-87c6-a1e489700673 </Value> </Property> <Property> <Name>TextField</Name> <Value xmlns:q6="http://www.w3.org/2001/XMLSchema" p4:type="q6:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">{766e0ffd-9bf4-433d-8c13-3d3e4b852ead} </Value> </Property> <Property> <Name>AnchorId</Name> <Value xmlns:q3="http://www.w3.org/2001/XMLSchema" p4:type="q3:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">00000000-0000-0000-0000-000000000000 </Value> </Property> <Property> <Name>IsPathRendered</Name> <Value xmlns:q7="http://www.w3.org/2001/XMLSchema" p4:type="q7:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">false </Value> </Property> <Property> <Name>IsKeyword</Name> <Value xmlns:q8="http://www.w3.org/2001/XMLSchema" p4:type="q8:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">false </Value> </Property> </ArrayOfProperty> </Customization> </Field>
References:
- https://www.itunity.com/article/configure-managed-navigation-sharepoint-2013-step-step-94
- https://github.com/SharePoint/PnP-Provisioning-Schema/issues/49
- https://technet.microsoft.com/en-us/library/jj613136.aspx
Published by