Counts all elements that are associated with at least one of the given keys in the element map with the specified identifier and satisfy the filter condition (if specified).

Effectively, this function does the same as the following expression:

findElementsByKeys (
   elementMapId, keys, filterQuery
).count()
However, it will work much faster than this.

Parameters:

elementMapId

The element map identifier

Note: When the element map with such an identifier does not exist, the generator shows the error message.

key
The array containing the hash keys
filterQuery
This parameter allows you to specify an additional condition on the counted elements.

When specified, this should be a boolean subquery created with BooleanQuery() function. The subquery will be processed against each initially selected element and should return true if the element must be counted and false otherwise. The tested element is passed as the generator context element.

Returns:

The number of counted elements.

See Also:

findElementsByKeys(), BooleanQuery()