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 * @license GPL-2.0-or-later
11 */
12interface ResultsType {
13    /**
14     * Get the source filtering to be used loading the result.
15     *
16     * @return false|string|array corresponding to Elasticsearch source filtering syntax
17     */
18    public function getSourceFiltering();
19
20    /**
21     * Get the fields to load.  Most of the time we'll use source filtering instead but
22     * some fields aren't part of the source.
23     *
24     * @return array corresponding to Elasticsearch fields syntax
25     */
26    public function getFields();
27
28    /**
29     * Get the highlighting configuration.
30     *
31     * @param array $extraHighlightFields configuration for how to highlight regex matches.
32     *  Empty if regex should be ignored.
33     * @return array|null highlighting configuration for elasticsearch
34     */
35    public function getHighlightingConfiguration( array $extraHighlightFields );
36
37    /**
38     * @param ElasticaResultSet $resultSet
39     * @return mixed Set of search results, the types of which vary by implementation.
40     */
41    public function transformElasticsearchResult( ElasticaResultSet $resultSet );
42
43    /**
44     * @return mixed Empty set of search results
45     */
46    public function createEmptyResult();
47}