Browse Source
feat(unified-search): Use existing min search length config
feat(unified-search): Use existing min search length config
This setting existed already for the legacy unified search. This commit expose that setting to the new front-end, and also ignore non valid requests in the backend. We also take the opportunity to register the config in the lexicon. Signed-off-by: Louis Chemineau <louis@chmn.me>pull/55299/head
committed by
Louis
10 changed files with 91 additions and 4 deletions
-
38core/AppInfo/ConfigLexicon.php
-
3core/Application.php
-
7core/Controller/UnifiedSearchController.php
-
19core/src/components/UnifiedSearch/UnifiedSearchModal.vue
-
1lib/composer/composer/autoload_classmap.php
-
1lib/composer/composer/autoload_static.php
-
4lib/private/Search/FilterCollection.php
-
8lib/private/Search/SearchComposer.php
-
7lib/private/TemplateLayout.php
-
7lib/public/Search/IFilterCollection.php
@ -0,0 +1,38 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
/** |
|||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors |
|||
* SPDX-License-Identifier: AGPL-3.0-or-later |
|||
*/ |
|||
|
|||
namespace OC\Core\AppInfo; |
|||
|
|||
use NCU\Config\Lexicon\ConfigLexiconEntry; |
|||
use NCU\Config\Lexicon\ConfigLexiconStrictness; |
|||
use NCU\Config\Lexicon\IConfigLexicon; |
|||
use NCU\Config\ValueType; |
|||
|
|||
/** |
|||
* Config Lexicon for core. |
|||
* |
|||
* Please Add & Manage your Config Keys in that file and keep the Lexicon up to date! |
|||
*/ |
|||
class ConfigLexicon implements IConfigLexicon { |
|||
public const UNIFIED_SEARCH_MIN_SEARCH_LENGTH = 'unified_search_min_search_length'; |
|||
|
|||
public function getStrictness(): ConfigLexiconStrictness { |
|||
return ConfigLexiconStrictness::IGNORE; |
|||
} |
|||
|
|||
public function getAppConfigs(): array { |
|||
return [ |
|||
new ConfigLexiconEntry(self::UNIFIED_SEARCH_MIN_SEARCH_LENGTH, ValueType::INT, 1, 'Minimum search length to trigger the request', lazy: false), |
|||
]; |
|||
} |
|||
|
|||
public function getUserConfigs(): array { |
|||
return [ |
|||
]; |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue