How to get a count of all topics in our Tridion Docs repo

Hi,

What is the most straightforward way to get a count of all topics in our Tridion Docs repo?

I am assuming I can do so with ISHRemote but not sure how to approach the script.

Any feedback appreciated,

Regards,

Ann

emoji
  • Hi Ann,

    A bit curious on why you are looking for the numbers. Just a one-off, or would you run this 'count' weekly, monthly, yearly, etc. Any numbers you are interested in as it could inspire/enrich our statistics epic.

    Genericly I can answer the below, remember that a database of 1 gigabyte acts differently than a 2 terrabyte one,...

    • Last run of DatabaseUpgradeTool/DBUT holds rough counts from your system. These rough numbers help to analyze upgrade issues as all customer databases are growing forever, however the product still needs to do conversion at times (on that growing data). Typically on the server in \InfoShare\App\Setup\DBUpgradeTool\ where the line you are interested in looks like "ContentObjects: 50473 [deleted:0]"
    • A one-off database query, however we offer no guarantees on the database structure across product versions, it is NOT an API. Plus long-running database queries are known to cause locking issues in the application, so the timing of running them matters.
    • ISHRemote (of course :-)) which relies on API calls, but is of course relatively slow as you are in essence iterating the whole Folder Structure, respecting business and security logic all the time. We don't have some counter readily available for you. The starting structure would look like below

    $imageCount = 0
    $xmlCount = 0
    Get-IshFolder -FolderPath "General\Myfolder" -FolderTypeFilter @("ISHIllustration", "ISHModule", "ISHMasterDoc", "ISHLibrary") -Recurse | 
    Get-IshFolderContent -VersionFilter "" | 
    ForEach-Object -Process { 
      if ($_.IshType -in @("ISHIllustration")) { ++$imageCount }
      if ($_.IshType -in @("ISHModule", "ISHMasterDoc", "ISHLibrary")) { ++$xmlCount }
    }
    Write-Host ("imageCount["+$imageCount+"]")
    Write-Host ("xmlCount["+$xmlCount+"]")

    Best wishes,
    Dave

    emoji
  • Hi Dave,

    We want to do a review and audit of our content to get a better handle on it.

    From what you say, it sounds like this may be better implemented as a request to RWS Support so I will reach out to them.

    Thanks for your feedback,

    Ann

    emoji
  • You can also search by date using IshRemote which avoids searching the whole repository at once. Borrowing some of Dave's code, the following will count objects created during December 2023 a day at a time. If you know when the earliest objects were created you can start there and work forward to today. Still takes a while but I've found it avoids issues with folder searches where they run for ages and then crash without telling you exactly why or where.

    $imageCount=0
    $xmlCount=0
    $endDate = [datetime]::parse("31/12/2023")
    $startDate = [datetime]::parse("01/12/2023")
    for($i = $startDate; $i -le $endDate; $i = $i.AddDays(1))
    {
        $searchDate=$i.ToString("d/MM/yyyy")
        write $searchDate
        $metafilter = Set-IshMetadataFilterField -Level Logical -Name CREATED-ON -FilterOperator Equal -Value $searchDate
        $Objs=Find-IshDocumentObj -MetadataFilter $metafilter |
            ForEach-Object -Process { 
              if ($_.IshType -in @("ISHIllustration")) { ++$imageCount }
              if ($_.IshType -in @("ISHModule", "ISHMasterDoc", "ISHLibrary")) { ++$xmlCount }
            }
    }
    Write-Host ("imageCount["+$imageCount+"]")
    Write-Host ("xmlCount["+$xmlCount+"]")

    emoji