Monday, 29 December 2014

Crawled properties not created for managed metadata field / Naming convention for note field associated with managed metadata column

 Hi again, today new problem and solution J and I feel this is very important one J

Background: In SharePoint 2013 when full crawl happens, Site Columns those have data for them managed and crawled properties are created automatically. For site column of type Taxonomy, SharePoint creates two types of crawled properties.

Consider my taxonomy field name is MyTaxonomyField and there is respective associated hidden Note field. In this case after full crawl SharePoint will create two crawled properties as
ows_taxid_MyTaxonomyField and

First crawled property (ows_taxid_MyTaxonomyField) is mapped with automatically created managed property owstaxidMyTaxonomyField. This managed property we should use everywhere in our queries in Content Search web part or in Search Result web part  since it contains the Term Id and we can query based on Term Ids.
For second crawled property (ows_MyTaxonomyField), managed property is not created automatically. We can create our own custom managed property and map with this crawled property. But then this is not the best practice, we couldn’t query based on Term Ids since this property contains only Term Names and not the Ids. There might be possibility of having the special characters in term names like “-“. Some of these special characters have different meaning in Search (KQL) and which may cause the search queries failure or no result.

Problem: In our project, for our Taxonomy fields first crawled properties (ows_taxid_MyTaxonomyField) is not getting created and hence no automatically created respective managed property. We have only second crawled property (ows_MyTaxonomyField) created but we don’t want to use it. In our Content Search web part we want to do the query based on TermIds.


We have following taxonomy field, here I kept only important attributes for the field others are removed:

<Field ID="{}"

         DisplayName="MyTaxonomyField _0"



  <Field ID="{}"
         Name=" MyTaxonomyField "


         DisplayName=" MyTaxonomyField "

         StaticName="MyTaxonomyField ">

First field is hidden Note field and second managed metadata field. Through feature receiver we are associating the Note field with Taxonomy field.
After digging / googling a lot it found that problem is in the naming convention of Note field. Note field associated with managed metadata field should contain the “TaxHTField” in its static name / Name.

So field should be like this
<Field ID="{}"

         DisplayName="MyTaxonomyField _0"



This is strange behaviour but it worked for our managed metadata fields. We spend lot of time in finding this, hopefully if same problem occurs it will save your time J
Enjoy Reading J

Feel free to comment / suggestion / feedback if any J

Friday, 26 December 2014

Usage analytics reports options (“Most Popular Items” and “Most Popular Trends”) are not available on Post or other lists

Hi Again,

Today new interesting and my favourite feature related issue and solutionJ. Our customer has reported the issue like they couldn’t see usage analytics reports options “Most Popular Items”, “Popularity Trends” for their post list. Like 

These are the two types of Usage analytics reports which SharePoint 2013 creates.

So we started investigation and first point to check is whether site collection level “Reporting” feature is activated or not.

“Reporting” feature is activated on site collection level. Also when we saw “Pages” library or “Document Libraries” these options are available. But not available for “Posts” list or some other lists in the site.

After googling bit in MS article “View usage reports in SharePoint Server 2013 ( )” it is mentioned that “Usage reports are only available for Usage reports are only available for Document Libraries and Product Catalog lists”.

Now, it’s clear that why these options are available only for “Pages” and “Document Libraries”. But our customer wants these options for “Post” list so one of the possible options is to activate the site collection level “Cross Site Publishing” feature.

But as soon as we activate this feature, “Catlogs Settings” one extra option under List/Library settings becomes available for all the lists and libraries in the Site collection.

From this “Catalog Settings” page we can actually enable list / library as a catalog.

Interestingly “Cross Site Publishing” feature is dependent on “Reporting” feature. If you try to activate the “Cross Site Publishing” feature without “Reporting” feature you will get feature dependency error as

The feature being activated is a Site Collection scoped feature which has a dependency on a Site Collection scoped feature which has not been activated. Please activate the following feature before trying again: Reporting 7094bd89-2cfe-490a-8c7e-fbace37b4a34

Once we have activated the “Cross Site Publishing” feature for all the lists we could see the usage analytics reports options J

Enjoy Reading J
Feel free to contact in case if you have any query / feedback / suggestions J

Wednesday, 24 December 2014

Office 365: Exception while activating publishing feature - Feature with Id ' ' is not installed in this farm, and cannot be added to this scope.

Hi All,

It’s again long time, busy with project, but continued on office 365 side. Sharing one small finding but could save your timeJ.

One of our requirements is to activate the publishing feature (“SharePoint Server Publishing Infrastructure”) on our one of the site collection which is of type Team site.

So we have CSOM + PowerShell approach and used following CSOM code to activate the features using PowerShell script

#getting all site features

$siteFeatures = $clientContext.Site.Features

#activating “SharePoint Server Publishing Infrastructure” feature

$featureId = “f6924d36-2fa8-4f0b-b16d-06b7250180fa”
$fId = [GUID]$featureId
$siteFeatures.Add($fId, $true, [Microsoft.SharePoint.Client.FeatureDefinitionScope]::Site)

As soon as above code executed we got the following error

An error occurred activating Feature. Error detail: Exception calling "ExecuteQuery" with "0" argument(s): "Feature with Id 'f6924d36-2fa8-4f0b-b16d-06b7250180fa' is not installed in this farm, and cannot be added to this scope.”

After digging a lot and went through couple of blogs, noticed that, in some blogs FeatureDefinitionScope is set to None. We tried this option and it worked like charmJ.

So it looks like as

$siteFeatures.Add($fId, $true, [Microsoft.SharePoint.Client.FeatureDefinitionScope]::None)

For now I am not sure is this bug or it works in this way but I really wondered why so this since there are 4 scopes in FeatureDefinitionScope enumeration as

using System;
    public enum

I then tried with the web level feature but same error and then it worked with None option.


While activating feature using CSOM it doesn’t accept respective scope (Site or Web), we need to provide feature definition scope as None.Thanks!

Enjoy reading :)

Feel free to comment / feedback if any :)