Beispiel #1
0
 /**
  *
  * @param string|nc_search_query $query
  * @param boolean $highlight_matches
  * @throws nc_search_exception
  * @return nc_search_result
  */
 public static function find($query, $highlight_matches = true)
 {
     if (self::should('EnableSearch')) {
         if (is_string($query)) {
             $query = new nc_search_query($query);
         }
         nc_search_util::set_utf_locale($query->get('language'));
         $result = self::get_provider()->find($query, $highlight_matches);
         nc_search_util::restore_locale();
         return $result;
     } else {
         throw new nc_search_exception("Search module is disabled");
     }
 }