code: public function countWithFilterAndSiteIds(PaginateFinderConfiguration $configuration, array $siteIds = null)
      {
          $qa = $this->createAggregateQueryWithDeletedFilter(false);
          if (null !== $siteIds) {
              $qa->match(array('siteId' => array('$in' => $siteIds)));
          }
          $this->filterSearch($configuration, $qa);
  
          return $this->countDocumentAggregateQuery($qa);
      }
docs: @param PaginateFinderConfiguration $configuration
  @param array|null                  $siteIds
  
  @return int