Monday 22 December 2014

In my current project requirement, we have to add query suggestions to sharepoint 2013 Search. Here is the powershell script thats been used to upload the query suggestion and kickstart the timer job as well.
  1. $Service = Get-SPEnterpriseSearchServiceApplicationProxy  
  2. $web = Get-SPWeb -Identity http://mysite/Test  
  3. $owner = Get-SPEnterpriseSearchOwner -Level SPWeb -SPWeb $web  
  4. $Fedmanager = New-Object Microsoft.Office.Server.Search.Administration.Query.FederationManager –ArgumentList $Service  
  5. $source = $Fedmanager.GetSourceByName("Local SharePoint Results", $owner)  
  6. Import-SPEnterpriseSearchPopularQueries -SearchApplicationProxy $Service -Filename C:\query.txt -ResultSource $source -Web $web  
  7. $timerjob = Get-SPTimerJob -type "Microsoft.Office.Server.Search.Administration.PrepareQuerySuggestionsJobDefinition"  
  8. $timerjob.RunNow()  

SharePoint 2013 : Enable developer Dashboard


Introduction :
 
Developer Dashboard is one of the great feature available on SharePoint 2013. Often used by SharePoint administrators, disabled by default, provides performance and tracing information.
 
Enabling this feature will help you get critical information about execution time, log correlation ID, critical events, database queries, service calls, SPRequests allocation and webpart events offsets.
 
There are following options available for Developer Dashboard : 
   1.   On
   2.   Off
   3.   OnDemand (Not available in SharePoint 2013; but was there in SharePoint 2010) 
 
Various Ways to Activate Developer Dashboard : 
 
   1.   PowerShell              
  1. $devDashBoard = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings  
  2. $devDashBoard.DisplayLevel = 'On'  
  3. $devDashBoard.TraceEnabled = $true  
  4. $devDashBoard.Update()  
   2.   STSADM        
  1. stsadm -o setproperty -pn developer-dashboard -pv On  
   3. SharePoint Object Model        
  1. using Microsoft.SharePoint.Administration;  
  2.   
  3. SPWebService oSPWebService = SPContext.Current.Site.WebApplication.WebService;   
  4. oSPWebService.DeveloperDashboardSettings.DisplayLevel =   
  5.     SPDeveloperDashboardLevel.On;   
  6. oSPWebService.DeveloperDashboardSettings.Update();  
 Upon successful activation of Developer Dashboard; you will find an icon in top right corner of SharePoint Site. As shown in below image.
 
 
 
Of course to revert back the settings again replace 'on' parameter with 'off' .
  
Happy SharePointing !!!! 

No comments:

Post a Comment