Extracting simple stats from Alfresco 5

How many documents are created in Alfresco by user?

Someone asked me the question this morning and I remembered that there was a simple SOLR REST service to recover such information from Alfresco 5.

The service can be invoked without parameters by using the following URL

http://localhost:8080/alfresco/s/api/solrstats

and a raw count of document and storage is produced

{
    "resultset": [
    ],
    "queryInfo": {
      "numberFound": "30758"
      ,"totalRows": "0"
         ,"sum": "37910306685"
         ,"max": "2706931488"
         ,"mean": "1239830"
    },
    "metadata": [
        {
            "colIndex": 0,
            "colType": "String",
            "colName": "name"
        },
        {
            "colIndex": 1,
            "colType": "Numeric",
            "colName": "sum"
        },
        {
            "colIndex": 2,
            "colType": "Numeric",
            "colName": "count"
        },
        {
            "colIndex": 3,
            "colType": "Numeric",
            "colName": "min"
        },
        {
            "colIndex": 4,
            "colType": "Numeric",
            "colName": "max"
        },
        {
            "colIndex": 5,
            "colType": "Numeric",
            "colName": "mean"
        }
    ]
}

However, using the listFacets parameter a list of available filters is obtained

http://localhost:8080/alfresco/s/api/solrstats?listFacets=true

[
      "content.mimetype",
      "content.creator",
      "content.modifier",
      "content.created.datetime",
      "content.modified.datetime",
      "content.encoding",
      "content.locale",
      "content.versionLabel",
      "exif.model",
      "exif.manufacturer",
      "exif.iso",
      "exif.focalLength",
      "exif.software"
]

And providing the right filter to the service, created contents by user stats are shown

http://localhost:8080/alfresco/s/api/solrstats?facet=content.creator

{
    "resultset": [
         ...
         ,
         ["angel.borroy",2195237313, 2515, 0, 101617524, 872857]
         ,
         ...
    ],
    "queryInfo": {
      "numberFound": "30758"
      ,"totalRows": "29"
         ,"sum": "37910306685"
         ,"max": "2706931488"
         ,"mean": "1239830"
    },
    "metadata": [
        {
            "colIndex": 0,
            "colType": "String",
            "colName": "name"
        },
        {
            "colIndex": 1,
            "colType": "Numeric",
            "colName": "sum"
        },
        {
            "colIndex": 2,
            "colType": "Numeric",
            "colName": "count"
        },
        {
            "colIndex": 3,
            "colType": "Numeric",
            "colName": "min"
        },
        {
            "colIndex": 4,
            "colType": "Numeric",
            "colName": "max"
        },
        {
            "colIndex": 5,
            "colType": "Numeric",
            "colName": "mean"
        }
    ]
}

It looks like I’ve created 2,515 documents at that Alfresco server installation.

Results may not be exact, as it’s based in SOLR indexation. However they are fine for general stats and comparative studies.

Anuncios

3 comentarios en “Extracting simple stats from Alfresco 5

  1. There’s lots of new functionality for stats, range, pivot using the public search api coming with 5.2.1; Which is due for release very soon (perhaps next week?).

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s