45 return $GLOBALS[
'SQ_SYSTEM']->am->installed(
'search_manager');
72 public static function processSearch($search_terms, $restrict_statuses=Array(), $restrict_asset_types=Array())
74 require_once SQ_INCLUDE_PATH.
'/general_occasional.inc';
77 $sm = $GLOBALS[
'SQ_SYSTEM']->am->getSystemAsset(
'search_manager');
80 if (empty($restrict_statuses)) {
81 $restrict_statuses = get_constant_values(
'SQ_STATUS_');
87 'words' => $search_terms,
88 'word_logic' =>
'AND',
89 'data_sources' => Array(
90 0 => Array(
'type' =>
'include_all'),
94 'statuses' => $restrict_statuses,
98 if (!empty($restrict_asset_types)) {
99 $search_info[
'asset_types'] = $restrict_asset_types;
103 $results = $sm->processSearch($search_info, TRUE);
105 if (!empty($results)) {
106 $result_limit = $GLOBALS[
'SQ_SYSTEM']->getUserPrefs(
'search_manager',
'SQ_SEARCH_BACKEND_RESULT_LIMIT');
107 $results = $sm->getCondensedResults($results);
108 if ($result_limit > 0) {
109 $results = array_slice($results, 0, $result_limit, TRUE);
111 $results = $sm->getFormattedResults($results, $search_terms, FALSE);