Get information for Number of item crawl by document type. RRS feed

  • Question

  • Hi, 

    With Fast it's easy to see the number of items crawled for content collection.

    But our clients need to get more details (how many documents, pages, list items, etc..).

    With other search engine (Coveo for instance) they were able to get report for each Document Type (Images, Word, Excel, etc) and the number of Items associated to it and the % of the total index that it represent.

    Will it be possible to get also this detail from Fast (at least for SharePoint crawls), with build-in .exe command or by PowerShell.

    Our environnement is SharePoint 2010 with Fast Search for SharePoint.




    Thursday, February 10, 2011 4:38 PM

All replies

  • You cannot do this with a built-in exe file, but you can create your own exe or powershell scripts/command which uses the Query API in order to search up this kind of information. This will of course take security into account as well.

    Another option is to create a custom pipeline stage which logs the information you want into for example a database which you can query.

    Mikael Svenson

    Search Enthusiast - MCTS SharePoint/WCF4/ASP.Net4 -
    Saturday, February 12, 2011 12:12 AM
  • Hi,

    Thanks for confirming what I tought. Could you guide me by suggesting me which powershell command could be a good start ?




    Monday, February 14, 2011 9:31 PM
  • There's no built-in command, but you can use the KeywordQuery object in powershell as well as in .Net code. Powershell allows instantiation of any .Net object.

    That said, I'm working on adding a refinement search powershell command to "SharePoint PowerShell Community Toolkit" which I hope to submit real soon. I'll try and post a short script doing the same as well.

    Basically you do an "empty" search and list all refiners available to you. The only drawback is that the search will be security enabled, returning what is available to the user running the powershell command, not necessarily what is in the index in total.


    Search Enthusiast - MCTS SharePoint/WCF4/ASP.Net4 -
    Monday, February 21, 2011 7:16 PM
  • Here goes. I've modified the sample at .. a to include all possible refiners. Change "FAST Query SSA" to the name of your own query ssa, and if you don't want to search for everything change the query from "#" to something else.

    $query = "#"
    $searchProxy = Get-SPEnterpriseSearchServiceApplicationProxy -Identity "FAST Query SSA"
    $schemaContext = new-object Microsoft.SharePoint.Search.Extended.Administration.SchemaContext
    $schema = $schemaContext.Schema
    $managedrefiners = $schema.AllManagedProperties | Where-Object { $_.RefinementEnabled } | Select-Object Name | ConvertTo-Csv -NoTypeInformation
    $refiner = [string]::join(',', $managedrefiners).Replace('"','').ToLower()
    $kq = new-object Microsoft.Office.Server.Search.Query.KeywordQuery($searchProxy)
    $kq.ResultsProvider = [Microsoft.Office.Server.Search.Query.SearchProvider]::FASTSearch
    $kq.QueryText = $query
    $kq.ResultTypes = [Microsoft.Office.Server.Search.Query.ResultType]::RefinementResults
    $kq.Refiners = $refiner
    $rtc = $kq.Execute()
    if ($rtc.Exists([Microsoft.Office.Server.Search.Query.ResultType]::RefinementResults))
      $rrt = $rtc.Item([Microsoft.Office.Server.Search.Query.ResultType]::RefinementResults)
      $rdt = $rrt.Table
      Write-Host ""
      if($rdt.Rows.Count -gt 0)
        Write-Host -ForegroundColor Yellow "Refinements"
        $rdt.Rows | Format-Table -autosize -property RefinerName, RefinementCount, RefinementName, RefinementToken
        write-Host -ForegroundColor Red "No refinements found for refiner " $refiner
    Mikael Svenson

    Search Enthusiast - MCTS SharePoint/WCF4/ASP.Net4 -
    Tuesday, February 22, 2011 8:11 PM