geonetwork/core-geonetwork — pull request #219 by fxprunayre (2013-08-06 14:07:34+00:00)
Title: Add services providing statistics about search and catalog content (retu...

Those service allows user to build client application displaying statistics about:
* search
* catalog content

2 families of services are defined

## Search statistics

### Service statistics-search

Return main metrics for the catalog and search service. Metrics are:
* activity_days: Number of days of activity
* activity_months: Number of months of activity
* total_searches: Total number of searches
* avg_searches_by_day: Average number of searches by day
* avg_searches_by_month: Average number of searches by month
* avg_views_by_day: Average number of metadata record views by day
* avg_views_by_month: Average number of metadata record views by month
* total_searches_with_no_hits: Number of searches with no hits

Parameters:
* service: the search service to compute statistics on (eg. service=csw)

URL: http://localhost:8080/geonetwork/srv/eng/statistics-search?service=q

Response:
```

48
1
31
0
31
4
219
0

```

### Service statistics-search-ip

Return unique IP address with number of searches.

URL: http://localhost:8080/geonetwork/srv/eng/statistics-search-ip

Response:
```

127.0.0.1
1058

```

### Service statistics-search-by-service-type

Return number of searches per service types.

URL: http://localhost:8080/geonetwork/srv/eng/statistics-search-by-service-type

Response:
```

q
971

csw
31

csw
keyword
17

csw
any
6

...
```

### Service statistics-search-terms

Return information about which search terms are used for a field.

URL: http://localhost:8080/geonetwork/srv/eng/statistics-search-terms?field=any&service=q

Parameters:
* field: Lucene search field (eg. field=any)
* service: the search service to compute statistics on (eg. service=csw)

Response:
```

africa
6

```

## Catalog content statistics

### Service statistics-content

Return information about the number of metadata records in the catalog:
* nb_metadata: Total number of records
* nb_harvested: Number of harvested records
* nb_template: Number of templates
* nb_subtemplate: Number of directory entries
* nb_metadata_public: Number of public metadata records

URL: http://localhost:8080/geonetwork/srv/eng/statistics-content

Response:
```

106
59
11
2
0

```

### Service statistics-content-metadata

Return statistics by type of records.

Parameters:
* by: Type of records
* schema: By metadata standards
* category: By category
* template: By metadata type
* harvest: Harvested or not
* source: By source catalog
* status: By metadata status
* validity: By metadata validation status
* owner: By owner
* groupowner: By group owner
* isTemplate: To return information for template (ie. "y"), metadata (ie "n"), directory entry (ie. "s") or all "%"

URL: http://localhost:8080/geonetwork/srv/eng/statistics-content-metadata?by=schema&isTemplate=n

Response:
```

iso19139
97

dublin-core
3

fgdc-std
3

iso19115
3

```

## Sample user interface using those services (not part of this proposal)

![geonetwork-dashboard-statistics-content](https://f.cloud.github.com/assets/1701393/917284/60566096-fea1-11e2-959b-3307c249a67c.png)
![geonetwork- dashboard-statistics-search](https://f.cloud.github.com/assets/1701393/917285/605d4276-fea1-11e2-9006-6ef5f7bdb09d.png)