/
Gateway.php
83 lines (74 loc) · 2.62 KB
/
Gateway.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
/**
* This file is part of the eZ Platform Solr Search Engine package.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*
* @version //autogentag//
*/
namespace EzSystems\EzPlatformSolrSearchEngine;
use eZ\Publish\API\Repository\Values\Content\Query;
/**
* The Content Search Gateway provides the implementation for one database to
* retrieve the desired content objects.
*/
abstract class Gateway
{
/**
* Returns search hits for the given query.
*
* @param \eZ\Publish\API\Repository\Values\Content\Query $query
* @param array $fieldFilters - a map of filters for the returned fields.
* Currently supported: <code>array("languages" => array(<language1>,..))</code>.
*
* @return mixed
*/
abstract public function findContent(Query $query, array $fieldFilters = array());
/**
* Returns search hits for the given query.
*
* @param \eZ\Publish\API\Repository\Values\Content\Query $query
* @param array $fieldFilters - a map of filters for the returned fields.
* Currently supported: <code>array("languages" => array(<language1>,..))</code>.
*
* @return mixed
*/
abstract public function findLocations(Query $query, array $fieldFilters = array());
/**
* Returns all search hits for given query, that will be performed on all endpoints.
*
* @param Query $query
* @return mixed
*/
abstract public function searchAllEndpoints(Query $query);
/**
* Indexes an array of documents.
*
* Documents are given as an array of the array of documents. The array of documents
* holds documents for all translations of the particular entity.
*
* @param \eZ\Publish\SPI\Search\Document[][] $documents
*/
abstract public function bulkIndexDocuments(array $documents);
/**
* Deletes documents by the given $query.
*
* @param string $query
*/
abstract public function deleteByQuery($query);
/**
* Purges all contents from the index.
*/
abstract public function purgeIndex();
/**
* Commits the data to the Solr index, making it available for search.
*
* This will perform Solr 'soft commit', which means there is no guarantee that data
* is actually written to the stable storage, it is only made available for search.
* Passing true will also write the data to the safe storage, ensuring durability.
*
* @param bool $flush
*/
abstract public function commit($flush = false);
}