Showing posts with label Search. Show all posts
Showing posts with label Search. Show all posts

Tuesday, February 2, 2016

SharePoint 2013 Usage service trouble shooting

Recently my farm encountered an issue with the Usage statistics not showing up in my reports but the data was still getting captured in the database.  


first thing to check are some status for your service application


$app = Get-SPServiceApplication -Identity '{Your usage service app guid}'


the get the usageapplication for some properties and status:


$ua = Get-SPUsageApplication -Identity $app


$ua.Status




if everything looks good, then make sure your usage definitions have Receivers:


$aud = Get-SPUsageDefinition | where {$_.Name -like "Analytics*"}


$aud | fl


$prud = Get-SPUsageDefinition | where {$_.Name -like "Page Requests"}


$prud | fl




Look at your results to make sure you have the following
-------------
EnableReceivers : True

Receivers : {Microsoft.Office.Server.Search.Analytics.Internal.AnalyticsCustomRequestUsageReceiver}





EnableReceivers : True

Receivers : {Microsoft.Office.Server.Search.Analytics.Internal.ViewRequestUsageReceiver}






finally if that's all good then unprovision your usage app and then go provision using Central admin:


first to unprovision:


$app = Get-SPServiceApplication -Identity '{Your usage service app guid}'
$app.Unprovision()


then in Central Admin, Monitoring, Configure usage and health data collection
-enable
-check items you want collected
-database name
-windows auth
-Ok


-----------------------------------------------------------------------------------------------------------------
Some very helpful links:


http://blogs.msdn.com/b/sharepoint_strategery/archive/2015/04/15/sp2013-search-index-health-reports-for-monitoring-and-troubleshooting.aspx




https://gallery.technet.microsoft.com/scriptcenter/Builds-SP-Search-2013-10d72a25


https://gallery.technet.microsoft.com/scriptcenter/Get-SPSearchTopologyState-b7452c6a



Tuesday, July 29, 2014

Create a new the crawl database and replace the old or corrupted crawl database in SharePoint 2013 Search

Recently the crawl database in sharepoint search got corrupted.   After we fixed the indexes, it kept getting corrupted so we just recreated the database and the issues went away.  Here are the steps and power shell.


#You will need to change the search service application name, also your sql server name, and the guid of you crawl store. 




Add-PSSnapin Microsoft.SharePoint.PowerShell


#List all crawl database:


Get-SPEnterpriseSearchCrawlDatabase -SearchApplication "Search service Application"




#Create a new Crawl database: 

New-SPEnterpriseSearchCrawlDatabase -DatabaseName "Search_Service_Application_CrawlStoreDB" -DatabaseServer "SQLServerName" -SearchApplication "Search Service Application"




#Delete the crawl store that is corrupted or old.

$ssa = Get-SPEnterpriseSearchServiceApplication -Identity "Search service Application"
$cs = $ssa.CrawlStores


#list the crawl stores to find the corrupted or old one

$cs


#delete the old/corrupted store


$cs1 = $cs.Item("GUID of Old database")
$cs1.Delete()




# if the search is in a System paused for refactoring, use the command below to normal


#$ssa = Get-SPEnterpriseSearchServiceApplication -Identity "Search service Application"
#$ssa.ForceResume($ssa.IsPaused())