Friday 20 June 2014

View Managed Property Values in SharePoint 2013 using Search REST API


When setting up SharePoint 2013 search schema a situation may arise where you want see the values associated with the managed properties you have setup. This can be easily achieved using the Search REST API which was introduced in SharePoint 2013. This API allows us to easily view values for any of the managed properties.

To  view results of a particular query we just need to pass the query as querytext parameter to the REST API as shown below

http://<SharePoint Site>/_api/search/query?querytext='<Your Query>’

This will return only the standard managed properties like author, modified etc. In order to make the search REST API return our custom managed properties we need to pass the property names to selectproperties parameter as shown below

http://<SharePoint Site>/_api/search/query?querytext='<Your Query>’ &selectproperties='<customproperty>'

We can view values for multiple managed properties by passing the property names separated by comma to the selectproperties parameter as shown below

http://<SharePoint Site>/_api/search/query?querytext='<Your Query>’ &selectproperties='<customproperty1>,<customproperty1>,<customproperty3>'

For example the below query to Search REST API will return values for the managed properties Title, Color, Brand as shown in the screen shot

http://MYSPServer/_api/search/query?querytext='Samsung ProXpress'&selectproperties='Title,ColorOWSTEXT,BrandOWSTEXT'
SharePoint 2013 Serch API
 

Thursday 12 June 2014

Creating SharePoint 2013 Subscription Settings Service Application

When trying to configure APP URL settings in new SharePoint 2013 environment, the configuration page displayed the message “The Subscription Settings service and corresponding application and proxy needs to be running in order to make changes to these settings” and didn’t provide any configuration options.


SharePoint 2013 Config App URL

Checking the services and service application in central admin showed that both the App Management Service and service application were created and running fine.  It took a while for me to realize that the Subscription Settings service application has not be created. This service application cannot be created from central admin UI but can only be created from PowerShell. Below are the PowerShell commands for creating the Subscription Settings service application


$acct = Get-SPManagedAccount <Account>
$appPool = New-SPServiceApplicationPool -Name SubscriptionServiceAppPool -Account $acct
$serviceApp = New-SPSubscriptionSettingsServiceApplication -ApplicationPool $appPool -name "Subscription Settings Service Application" -DatabaseName "<Database Name>"
$serviceAppProxy = New-SPSubscriptionSettingsServiceApplicationProxy -ServiceApplication $serviceApp

Once the Subscription Settings Service Application is created we will be able to configure App URLS .


Monday 2 June 2014

Fix for Disabled Activate Solution button in SharePoint 2013

 

In a brand new SharePoint 2013 server installation, when you try to activate a solution after uploading the solution file to solution gallery you would see that the activate button is disabled even if you have logged in as the administrator. This will happen if the Microsoft SharePoint Foundation Sandboxed Code Service is not activated on the server. 
To fix the problem go to SharePoint 2013 central administration à System Settings à Manage Services on Server page and start the Microsoft SharePoint Foundation Sandboxed Code Service.  After starting the service you will be able to go to the solution gallery and activate your solutions.