Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

scope

The scope object. The segment must be within the scope.

NOTE: This method does not support the Global Search scope.


object, Mandatory
aggregations

An array that contains the aggregation IDs to calculate. Get the available IDs with this API call.

Example to obtain results of 3 aggregations:

Code Block
{
   "scope": {....}
   "aggregations": [
		{ "id": "textModified", "interval": "week" },
		{ "id": "textStatus" },
		{ "id": "textModifiedByUser", "perLocale": false }
	]
}


array, Mandatory
query

An optional filter. See query parameter described here: resources/segments/search

Important with TextLevel and TextLocaleLevel aggregations:

Such aggregations operate on text/term fields and thus need to know the languages to look at.

  • If you do not specify the query property then the system will do the calculations for ALL languages in the scope.
  • If you specify a query then you MUST set the "languages" property and indicate the exact languages you want to analyse.


Important: When specifying multiple languages in the query AND conditions on language level: Results are correct bur may appear unintuitive.

See chapter MULTI-LANGUAGE QUERIES - SPECIAL NOTES further down this page.


object, Optional
usecache

Optional, default is true.

True is performance optimized and caches information about the data of the scope.

Set to false for example to make the system be aware of any changes to languages (e.g. languages added to a resource).

bool?, Optional

...

  • The results are shown for languages en and es
  • The buckets node shows the count per numeric bookmark ID (key). For convenience the bookmark title is printed.
  • total is the total count in the buckets

  • scanned is a technical information and should not be displayed to end users. It indicates the total number of segments that were scanned to calculate the aggregations. 
  • scannedErrors is a technical information indicating how accurate scanned is. For example a value of 10 means that the shown total is +/- 10.


MULTI-LANGUAGE QUERIES - SPECIAL NOTES

Text-level aggregations may yield a-priori unintuitive results when a query defines multiple languages and also has conditions on language properties. Example:

Code Block
"query": {
        "languages": [
            {
                "locs": ["en-GB","de-CH","fr-CH","it-IT"],
                "updateDate": { "min": "2020-12-14T00:00:00", "max": "2020-12-14T23:59:59" }
            }
        ]
    }


In fact, this query selects segments where at least 1 language matches the conditions (on the last update date in the example above). 1 language in a segment might match the condition but maybe the other 2 languages do not.  Now, if you requested a text-level aggregation then you should be aware that all the 3 languages will be aggregated - whether they matched the condition above or not.

A typical example would be the "textModified" aggregation. If "en-GB" was modified on 2020-12-14 in a segment it will be aggregated for that date. If the other languages in the same segment were aggregated on 2020-12-01 then these will be aggregated into this date bucket.  The result is correct but you probably did not expect date buckets outside the requested range.

If this is problematic for your use case then please specify a single language in the query (or run separate aggregations per each language).


EXAMPLES

See here:

Child pages (Children Display)

...