Skip to content

Commit f313b12

Browse files
authored
Merge pull request #41436 from nextcloud/feat/introduce-inAppSearch-method-for-advanced-search
Add `inAppSearch` for advanced search providers
2 parents 5f69640 + 174b76f commit f313b12

File tree

6 files changed

+44
-1
lines changed

6 files changed

+44
-1
lines changed

core/ResponseDefinitions.php

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
* order: int,
105105
* triggers: string[],
106106
* filters: array<string, string>,
107+
* inAppSearch: bool,
107108
* }
108109
*
109110
* @psalm-type CoreUnifiedSearchResultEntry = array{

core/openapi.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,8 @@
512512
"icon",
513513
"order",
514514
"triggers",
515-
"filters"
515+
"filters",
516+
"inAppSearch"
516517
],
517518
"properties": {
518519
"id": {
@@ -542,6 +543,9 @@
542543
"additionalProperties": {
543544
"type": "string"
544545
}
546+
},
547+
"inAppSearch": {
548+
"type": "boolean"
545549
}
546550
}
547551
},

lib/composer/composer/autoload_classmap.php

+1
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@
593593
'OCP\\Search\\IFilter' => $baseDir . '/lib/public/Search/IFilter.php',
594594
'OCP\\Search\\IFilterCollection' => $baseDir . '/lib/public/Search/IFilterCollection.php',
595595
'OCP\\Search\\IFilteringProvider' => $baseDir . '/lib/public/Search/IFilteringProvider.php',
596+
'OCP\\Search\\IInAppSearch' => $baseDir . '/lib/public/Search/IInAppSearch.php',
596597
'OCP\\Search\\IProvider' => $baseDir . '/lib/public/Search/IProvider.php',
597598
'OCP\\Search\\ISearchQuery' => $baseDir . '/lib/public/Search/ISearchQuery.php',
598599
'OCP\\Search\\PagedProvider' => $baseDir . '/lib/public/Search/PagedProvider.php',

lib/composer/composer/autoload_static.php

+1
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,7 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
626626
'OCP\\Search\\IFilter' => __DIR__ . '/../../..' . '/lib/public/Search/IFilter.php',
627627
'OCP\\Search\\IFilterCollection' => __DIR__ . '/../../..' . '/lib/public/Search/IFilterCollection.php',
628628
'OCP\\Search\\IFilteringProvider' => __DIR__ . '/../../..' . '/lib/public/Search/IFilteringProvider.php',
629+
'OCP\\Search\\IInAppSearch' => __DIR__ . '/../../..' . '/lib/public/Search/IInAppSearch.php',
629630
'OCP\\Search\\IProvider' => __DIR__ . '/../../..' . '/lib/public/Search/IProvider.php',
630631
'OCP\\Search\\ISearchQuery' => __DIR__ . '/../../..' . '/lib/public/Search/ISearchQuery.php',
631632
'OCP\\Search\\PagedProvider' => __DIR__ . '/../../..' . '/lib/public/Search/PagedProvider.php',

lib/private/Search/SearchComposer.php

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
use OCP\IURLGenerator;
3232
use OCP\Search\FilterDefinition;
3333
use OCP\Search\IFilteringProvider;
34+
use OCP\Search\IInAppSearch;
3435
use OC\AppFramework\Bootstrap\Coordinator;
3536
use OCP\IUser;
3637
use OCP\Search\IFilter;
@@ -199,6 +200,7 @@ function (array $providerData) use ($route, $routeParameters) {
199200
'order' => $provider->getOrder($route, $routeParameters),
200201
'triggers' => $triggers,
201202
'filters' => $this->getFiltersType($filters, $provider->getId()),
203+
'inAppSearch' => $provider instanceof IInAppSearch,
202204
];
203205
},
204206
$this->providers,

lib/public/Search/IInAppSearch.php

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* @copyright 2023 Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
7+
*
8+
* @author Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
9+
*
10+
* @license GNU AGPL version 3 or any later version
11+
*
12+
* This program is free software: you can redistribute it and/or modify
13+
* it under the terms of the GNU Affero General Public License as
14+
* published by the Free Software Foundation, either version 3 of the
15+
* License, or (at your option) any later version.
16+
*
17+
* This program is distributed in the hope that it will be useful,
18+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+
* GNU Affero General Public License for more details.
21+
*
22+
* You should have received a copy of the GNU Affero General Public License
23+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
24+
*
25+
*/
26+
namespace OCP\Search;
27+
28+
/**
29+
* Interface for search providers supporting in-app search
30+
*
31+
* @since 28.0.0
32+
*/
33+
interface IInAppSearch extends IProvider {
34+
}

0 commit comments

Comments
 (0)