protected function getTopKeyWordsWithOrWithoutHits(int $rootPageId, int $days = 30, int $limit = 10, bool $withoutHits = false) : array
    {
        $now = time();
        $timeStart = $now - 86400 * $days; // 86400 seconds/day

        $queryBuilder = $this->getPreparedQueryBuilderForSearchStatisticsAndTopKeywords($rootPageId, $timeStart, $limit);
        // Check if we want without or with hits
        if ($withoutHits === true) {
            $queryBuilder->andWhere($queryBuilder->expr()->eq('num_found', 0));
        } else {
            $queryBuilder->andWhere($queryBuilder->expr()->gt('num_found', 0));
        }

        return $queryBuilder->execute()->fetchAll();
    }
protected function getTopKeyWordsWithOrWithoutHits(int $rootPageId, int $days = 30, int $limit = 10, bool $withoutHits = false) : array
    {
        $now = time();
        $timeStart = $now - 86400 * $days; // 86400 seconds/day

        $queryBuilder = $this->getPreparedQueryBuilderForSearchStatisticsAndTopKeywords($rootPageId, $timeStart, $limit);
        // Check if we want without or with hits
        if ($withoutHits === true) {
            $queryBuilder->andWhere($queryBuilder->expr()->eq('num_found', 0));
        } else {
            $queryBuilder->andWhere($queryBuilder->expr()->gt('num_found', 0));
        }

        return $queryBuilder->execute()->fetchAll();
    }
protected function getTopKeyWordsWithOrWithoutHits ( int $ rootPageId , int $ days = 30 , int $ limit = 10 , bool $ withoutHits = false ) : array { $ now = time ( ) ; $ timeStart = $ now - 86400 * $ days ; // 86400 seconds/day $ queryBuilder = $ this -> getPreparedQueryBuilderForSearchStatisticsAndTopKeywords ( $ rootPageId , $ timeStart , $ limit ) ; // Check if we want without or with hits if ( $ withoutHits === true ) { $ queryBuilder -> andWhere ( $ queryBuilder -> expr ( ) -> eq ( 'num_found' , 0 ) ) ; } else { $ queryBuilder -> andWhere ( $ queryBuilder -> expr ( ) -> gt ( 'num_found' , 0 ) ) ; } return $ queryBuilder -> execute ( ) -> fetchAll ( ) ; }
Find Top search keywords with or without results

@param int $rootPageId
@param int $days number of days of history to query
@param int $limit
@param bool $withoutHits
@return array
Find Top search keywords with or without results