Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3namespace CirrusSearch\Search;
4
5use Elastica\ResultSet as ElasticaResultSet;
6
7/**
8 * Lightweight classes to describe specific result types we can return.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 * http://www.gnu.org/copyleft/gpl.html
24 */
25interface ResultsType {
26    /**
27     * Get the source filtering to be used loading the result.
28     *
29     * @return false|string|array corresponding to Elasticsearch source filtering syntax
30     */
31    public function getSourceFiltering();
32
33    /**
34     * Get the fields to load.  Most of the time we'll use source filtering instead but
35     * some fields aren't part of the source.
36     *
37     * @return array corresponding to Elasticsearch fields syntax
38     */
39    public function getFields();
40
41    /**
42     * Get the highlighting configuration.
43     *
44     * @param array $extraHighlightFields configuration for how to highlight regex matches.
45     *  Empty if regex should be ignored.
46     * @return array|null highlighting configuration for elasticsearch
47     */
48    public function getHighlightingConfiguration( array $extraHighlightFields );
49
50    /**
51     * @param ElasticaResultSet $resultSet
52     * @return mixed Set of search results, the types of which vary by implementation.
53     */
54    public function transformElasticsearchResult( ElasticaResultSet $resultSet );
55
56    /**
57     * @return mixed Empty set of search results
58     */
59    public function createEmptyResult();
60}