function fetchSearchList( $offset, $limit )
    {
        $parameters = array( 'offset' => $offset, 'limit'  => $limit );
        $mostFrequentPhraseArray = eZSearchLog::mostFrequentPhraseArray( $parameters );

        return array( 'result' => $mostFrequentPhraseArray );
    }
예제 #2
0
파일: search.php 프로젝트: legende91/ez
    $tpl->setVariable("page_limit", $pageLimit);
    $tpl->setVariable("search_text_enc", urlencode($searchText));
    $tpl->setVariable("search_result", $searchResult["SearchResult"]);
    $tpl->setVariable("search_count", $searchResult["SearchCount"]);
    $tpl->setVariable("stop_word_array", $searchResult["StopWordArray"]);
    if (isset($searchResult["SearchExtras"])) {
        $tpl->setVariable("search_extras", $searchResult["SearchExtras"]);
    }
} else {
    $tpl->setVariable("offset", false);
    $tpl->setVariable("page_limit", false);
    $tpl->setVariable("search_text_enc", false);
    $tpl->setVariable("search_result", false);
    $tpl->setVariable("search_count", false);
    $tpl->setVariable("stop_word_array", false);
}
// --- Compatibility code end ---
$Result = array();
$Result['content'] = $tpl->fetch("design:content/search.tpl");
$Result['path'] = array(array('text' => ezpI18n::tr('kernel/content', 'Search'), 'url' => false));
$searchData = false;
if (!$useSearchCode) {
    if ($tpl->hasVariable("search_data")) {
        $searchData = $tpl->variable("search_data");
    }
} else {
    $searchData = $searchResult;
}
if ($logSearchStats and trim($searchText) != "" and is_array($searchData) and array_key_exists('SearchCount', $searchData) and is_numeric($searchData['SearchCount'])) {
    eZSearchLog::addPhrase($searchText, $searchData["SearchCount"]);
}
예제 #3
0
if ( $clean['collaboration'] )
{
    $cli->output( "Removing all collaboration elements" );
    eZCollaborationItem::cleanup();
}

if ( $clean['collectedinformation'] )
{
    $cli->output( "Removing all collected information" );
    eZInformationCollection::cleanup();
}

if ( $clean['notification'] )
{
    $cli->output( "Removing all notifications events" );
    eZNotificationEvent::cleanup();
    eZNotificationCollection::cleanup();
    eZNotificationEventFilter::cleanup();
}

if ( $clean['searchstats'] )
{
    $cli->output( "Removing all search statistics" );
    eZSearchLog::removeStatistics();
}


$script->shutdown();

?>
예제 #4
0
파일: stats.php 프로젝트: legende91/ez
        case '3':
            $limit = 50;
            break;
        default:
            $limit = 10;
            break;
    }
} else {
    $limit = 10;
}
$offset = $Params['Offset'];
if (!is_numeric($offset)) {
    $offset = 0;
}
$http = eZHTTPTool::instance();
$module = $Params['Module'];
if ($module->isCurrentAction('ResetSearchStats')) {
    eZSearchLog::removeStatistics();
}
$viewParameters = array('offset' => $offset, 'limit' => $limit);
$tpl = eZTemplate::factory();
$db = eZDB::instance();
$query = "SELECT count(*) as count FROM ezsearch_search_phrase";
$searchListCount = $db->arrayQuery($query);
$mostFrequentPhraseArray = eZSearchLog::mostFrequentPhraseArray($viewParameters);
$tpl->setVariable("view_parameters", $viewParameters);
$tpl->setVariable("most_frequent_phrase_array", $mostFrequentPhraseArray);
$tpl->setVariable("search_list_count", $searchListCount[0]['count']);
$Result = array();
$Result['content'] = $tpl->fetch("design:search/stats.tpl");
$Result['path'] = array(array('text' => ezpI18n::tr('kernel/search', 'Search stats'), 'url' => false));