mirror of
https://github.com/nextcloud/server.git
synced 2026-04-21 06:08:46 -04:00
Add new method inAppSearch for advanced search providers
Allows to indicates if a search provider also support in app search Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
This commit is contained in:
parent
eaaf954753
commit
174b76fff3
6 changed files with 44 additions and 1 deletions
|
|
@ -104,6 +104,7 @@ namespace OCA\Core;
|
|||
* order: int,
|
||||
* triggers: string[],
|
||||
* filters: array<string, string>,
|
||||
* inAppSearch: bool,
|
||||
* }
|
||||
*
|
||||
* @psalm-type CoreUnifiedSearchResultEntry = array{
|
||||
|
|
|
|||
|
|
@ -512,7 +512,8 @@
|
|||
"icon",
|
||||
"order",
|
||||
"triggers",
|
||||
"filters"
|
||||
"filters",
|
||||
"inAppSearch"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
|
|
@ -542,6 +543,9 @@
|
|||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"inAppSearch": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -593,6 +593,7 @@ return array(
|
|||
'OCP\\Search\\IFilter' => $baseDir . '/lib/public/Search/IFilter.php',
|
||||
'OCP\\Search\\IFilterCollection' => $baseDir . '/lib/public/Search/IFilterCollection.php',
|
||||
'OCP\\Search\\IFilteringProvider' => $baseDir . '/lib/public/Search/IFilteringProvider.php',
|
||||
'OCP\\Search\\IInAppSearch' => $baseDir . '/lib/public/Search/IInAppSearch.php',
|
||||
'OCP\\Search\\IProvider' => $baseDir . '/lib/public/Search/IProvider.php',
|
||||
'OCP\\Search\\ISearchQuery' => $baseDir . '/lib/public/Search/ISearchQuery.php',
|
||||
'OCP\\Search\\PagedProvider' => $baseDir . '/lib/public/Search/PagedProvider.php',
|
||||
|
|
|
|||
|
|
@ -626,6 +626,7 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
|
|||
'OCP\\Search\\IFilter' => __DIR__ . '/../../..' . '/lib/public/Search/IFilter.php',
|
||||
'OCP\\Search\\IFilterCollection' => __DIR__ . '/../../..' . '/lib/public/Search/IFilterCollection.php',
|
||||
'OCP\\Search\\IFilteringProvider' => __DIR__ . '/../../..' . '/lib/public/Search/IFilteringProvider.php',
|
||||
'OCP\\Search\\IInAppSearch' => __DIR__ . '/../../..' . '/lib/public/Search/IInAppSearch.php',
|
||||
'OCP\\Search\\IProvider' => __DIR__ . '/../../..' . '/lib/public/Search/IProvider.php',
|
||||
'OCP\\Search\\ISearchQuery' => __DIR__ . '/../../..' . '/lib/public/Search/ISearchQuery.php',
|
||||
'OCP\\Search\\PagedProvider' => __DIR__ . '/../../..' . '/lib/public/Search/PagedProvider.php',
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ use InvalidArgumentException;
|
|||
use OCP\IURLGenerator;
|
||||
use OCP\Search\FilterDefinition;
|
||||
use OCP\Search\IFilteringProvider;
|
||||
use OCP\Search\IInAppSearch;
|
||||
use OC\AppFramework\Bootstrap\Coordinator;
|
||||
use OCP\IUser;
|
||||
use OCP\Search\IFilter;
|
||||
|
|
@ -199,6 +200,7 @@ class SearchComposer {
|
|||
'order' => $provider->getOrder($route, $routeParameters),
|
||||
'triggers' => $triggers,
|
||||
'filters' => $this->getFiltersType($filters, $provider->getId()),
|
||||
'inAppSearch' => $provider instanceof IInAppSearch,
|
||||
];
|
||||
},
|
||||
$this->providers,
|
||||
|
|
|
|||
34
lib/public/Search/IInAppSearch.php
Normal file
34
lib/public/Search/IInAppSearch.php
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @copyright 2023 Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
|
||||
*
|
||||
* @author Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
namespace OCP\Search;
|
||||
|
||||
/**
|
||||
* Interface for search providers supporting in-app search
|
||||
*
|
||||
* @since 28.0.0
|
||||
*/
|
||||
interface IInAppSearch extends IProvider {
|
||||
}
|
||||
Loading…
Reference in a new issue