0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-01-16 08:09:00 +00:00
nextcloud_server/lib/public/FullTextSearch/Service/ISearchService.php
Andy Scherzinger dae7c159f7
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-24 13:11:22 +02:00

60 lines
1.4 KiB
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\FullTextSearch\Service;
use OCP\FullTextSearch\Model\ISearchRequest;
use OCP\FullTextSearch\Model\ISearchResult;
/**
* Interface ISearchService
*
* @since 15.0.0
*
*/
interface ISearchService {
/**
* generate a search request, based on an array:
*
* $request =
* [
* 'providers' => (string/array) 'all'
* 'author' => (string) owner of the document.
* 'search' => (string) search string,
* 'size' => (int) number of items to be return
* 'page' => (int) page
* 'parts' => (array) parts of document to search within,
* 'options' = (array) search options,
* 'tags' => (array) tags,
* 'metatags' => (array) metatags,
* 'subtags' => (array) subtags
* ]
*
* 'providers' can be an array of providerIds
*
* @since 15.0.0
*
* @param array $request
*
* @return ISearchRequest
*/
public function generateSearchRequest(array $request): ISearchRequest;
/**
* Search documents
*
* @since 15.0.0
*
* @param string $userId
* @param ISearchRequest $searchRequest
*
* @return ISearchResult[]
*/
public function search(string $userId, ISearchRequest $searchRequest): array;
}