mirror of
https://github.com/nextcloud/server.git
synced 2024-09-03 17:56:31 +02:00
Merge pull request #41436 from nextcloud/feat/introduce-inAppSearch-method-for-advanced-search
Add `inAppSearch` for advanced search providers
This commit is contained in:
commit
f313b12d54
@ -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 New Issue
Block a user