diff --git a/core/js/js.js b/core/js/js.js
index 6ed50b42bd5097ba47295c357451c9c9330825ea..2073fc4d4b7fe0355b98db14c4d67d48194b3483 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -113,7 +113,7 @@ var OC={
 			}
 			link+=file;
 		}else{
-			if ((app == 'settings' || app == 'core') && type == 'ajax') {
+			if ((app == 'settings' || app == 'core' || app == 'search') && type == 'ajax') {
 				link+='/index.php/';
 			}
 			else {
diff --git a/core/routes.php b/core/routes.php
index 186fa8ae562a0fddee319a933f03057066877bc4..5c99c542d48089aabc21e3777b80410330a48ce0 100644
--- a/core/routes.php
+++ b/core/routes.php
@@ -9,6 +9,9 @@
 require_once 'settings/routes.php';
 
 // Core ajax actions
+// Search
+$this->create('search_ajax_search', '/search/ajax/search.php')
+	->actionInclude('search/ajax/search.php');
 // AppConfig
 $this->create('core_ajax_appconfig', '/core/ajax/appconfig.php')
 	->actionInclude('core/ajax/appconfig.php');
diff --git a/search/ajax/search.php b/search/ajax/search.php
index 41ee9ad5abacbef9ec3d9c7e39427ecc08aec47d..f0ca5752b9a731a91a5ed6102c5d3b67c2259966 100644
--- a/search/ajax/search.php
+++ b/search/ajax/search.php
@@ -21,17 +21,15 @@
 *
 */
 
-
-// Init owncloud
-require_once '../../lib/base.php';
-
 // Check if we are a user
 OC_JSON::checkLoggedIn();
+OC_App::loadApps();
 
 $query=(isset($_GET['query']))?$_GET['query']:'';
 if($query) {
 	$result=OC_Search::search($query);
 	OC_JSON::encodedPrint($result);
-}else{
+}
+else {
 	echo 'false';
 }