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:
However, it will work much faster than this.findElementsByKeys ( elementMapId, keys, filterQuery ).count()
Parameters:
elementMapId
The element map identifier.Note: When the element map with such an identifier does not exist, the generator raises an error.
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 returntrue
if the element must be counted andfalse
otherwise. The tested element is passed as the generator context element.
Returns:
The number of counted elements.
See Also:
findElementsByKeys(), BooleanQuery()