1 | <?php |
||
22 | class RawPaginatorAdapter implements PaginatorAdapterInterface |
||
23 | { |
||
24 | /** |
||
25 | * @var SearchableInterface the object to search in |
||
26 | */ |
||
27 | private $searchable; |
||
28 | |||
29 | /** |
||
30 | * @var Query the query to search |
||
31 | */ |
||
32 | private $query; |
||
33 | |||
34 | /** |
||
35 | * @var array search options |
||
36 | */ |
||
37 | private $options; |
||
38 | |||
39 | /** |
||
40 | * @var int the number of hits |
||
41 | */ |
||
42 | private $totalHits; |
||
43 | |||
44 | /** |
||
45 | * @var array for the aggregations |
||
46 | */ |
||
47 | private $aggregations; |
||
48 | |||
49 | /** |
||
50 | * @var array for the suggesters |
||
51 | */ |
||
52 | private $suggests; |
||
53 | |||
54 | /** |
||
55 | * @var float |
||
56 | */ |
||
57 | private $maxScore; |
||
58 | |||
59 | /** |
||
60 | * @see PaginatorAdapterInterface::__construct |
||
61 | * |
||
62 | * @param SearchableInterface $searchable the object to search in |
||
63 | * @param Query $query the query to search |
||
64 | */ |
||
65 | 11 | public function __construct(SearchableInterface $searchable, Query $query, array $options = []) |
|
71 | |||
72 | /** |
||
73 | * {@inheritdoc} |
||
74 | */ |
||
75 | public function getResults($offset, $itemCountPerPage) |
||
79 | |||
80 | /** |
||
81 | * Returns the number of results. |
||
82 | * |
||
83 | * If genuineTotal is provided as true, total hits is returned from the |
||
84 | * hits.total value from the search results instead of just returning |
||
85 | * the requested size. |
||
86 | * |
||
87 | * {@inheritdoc} |
||
88 | */ |
||
89 | 2 | public function getTotalHits($genuineTotal = false) |
|
99 | |||
100 | /** |
||
101 | * {@inheritdoc} |
||
102 | */ |
||
103 | 1 | public function getAggregations() |
|
111 | |||
112 | /** |
||
113 | * {@inheritdoc} |
||
114 | */ |
||
115 | 1 | public function getSuggests() |
|
123 | |||
124 | /** |
||
125 | * @return float |
||
126 | */ |
||
127 | 1 | public function getMaxScore() |
|
135 | |||
136 | /** |
||
137 | * Returns the Query. |
||
138 | * |
||
139 | * @return Query the search query |
||
140 | */ |
||
141 | 1 | public function getQuery() |
|
145 | |||
146 | /** |
||
147 | * Returns the paginated results. |
||
148 | * |
||
149 | * @param int $offset |
||
150 | * @param int $itemCountPerPage |
||
151 | * |
||
152 | * @throws \InvalidArgumentException |
||
153 | * |
||
154 | * @return ResultSet |
||
155 | */ |
||
156 | protected function getElasticaResults($offset, $itemCountPerPage) |
||
184 | } |
||
185 |