@@ -106,12 +106,18 @@ public function __construct($renderAs, $appId = '') {
106106
107107 $ this ->initialState ->provideInitialState ('core ' , 'active-app ' , $ this ->navigationManager ->getActiveEntry ());
108108 $ this ->initialState ->provideInitialState ('core ' , 'apps ' , $ this ->navigationManager ->getAll ());
109- $ this ->initialState ->provideInitialState ('unified-search ' , 'limit-default ' , (int )$ this ->config ->getAppValue ('core ' , 'unified-search.limit-default ' , (string )SearchQuery::LIMIT_DEFAULT ));
110- $ this ->initialState ->provideInitialState ('unified-search ' , 'min-search-length ' , (int )$ this ->config ->getAppValue ('core ' , 'unified-search.min-search-length ' , (string )1 ));
111- $ this ->initialState ->provideInitialState ('unified-search ' , 'live-search ' , $ this ->config ->getAppValue ('core ' , 'unified-search.live-search ' , 'yes ' ) === 'yes ' );
112- Util::addScript ('core ' , 'unified-search ' , 'core ' );
113- Util::addScript ('core ' , 'global-search ' , 'core ' );
114-
109+ /*
110+ * NB : Unified search enabled, defaults to true since new advanced search is
111+ * unstable. Once we think otherwise, the default should be false.
112+ */
113+ if ($ this ->config ->getSystemValueBool ('unified_search.enabled ' , true )) {
114+ $ this ->initialState ->provideInitialState ('unified-search ' , 'limit-default ' , (int )$ this ->config ->getAppValue ('core ' , 'unified-search.limit-default ' , (string )SearchQuery::LIMIT_DEFAULT ));
115+ $ this ->initialState ->provideInitialState ('unified-search ' , 'min-search-length ' , (int )$ this ->config ->getAppValue ('core ' , 'unified-search.min-search-length ' , (string )1 ));
116+ $ this ->initialState ->provideInitialState ('unified-search ' , 'live-search ' , $ this ->config ->getAppValue ('core ' , 'unified-search.live-search ' , 'yes ' ) === 'yes ' );
117+ Util::addScript ('core ' , 'unified-search ' , 'core ' );
118+ } else {
119+ Util::addScript ('core ' , 'global-search ' , 'core ' );
120+ }
115121 // Set body data-theme
116122 $ this ->assign ('enabledThemes ' , []);
117123 if (\OC ::$ server ->getAppManager ()->isEnabledForUser ('theming ' ) && class_exists ('\OCA\Theming\Service\ThemesService ' )) {
0 commit comments