1 | <?php |
||
18 | abstract class QueryAbstract extends CollectionAbstract implements PaginableInterface |
||
19 | { |
||
20 | public function set($key, $value) |
||
26 | |||
27 | /** |
||
28 | * @param \Gpupo\Search\Query\KeywordsInterface $keywords |
||
29 | */ |
||
30 | public function __construct(KeywordsInterface $keywords = null) |
||
44 | |||
45 | /** |
||
46 | * Objeto de pesquisa. |
||
47 | * |
||
48 | * @param \Gpupo\Search\Query\KeywordsInterface $keyword |
||
49 | * |
||
50 | * @return type |
||
51 | */ |
||
52 | public function setKeyword(KeywordsInterface $keyword) |
||
56 | |||
57 | public function setKeywords(array $keywordsList) |
||
67 | |||
68 | /** |
||
69 | * Acesso a um conjunto de KeywordsInterface. |
||
70 | * |
||
71 | * @todo Evoluir o uso da busca facetada para mais de uma Keyword |
||
72 | */ |
||
73 | public function getKeywords() |
||
79 | |||
80 | public function getFilters() |
||
88 | |||
89 | /** |
||
90 | * SphinxSearch Queries Array. |
||
91 | * |
||
92 | * <code> |
||
93 | * |
||
94 | * //Search single query sintaxe: |
||
95 | * array( |
||
96 | * array( |
||
97 | * 'key' => 'search_key', // The key to search on |
||
98 | * 'values' => array( // The values to match with |
||
99 | * 'value_one', |
||
100 | * 'value_two', |
||
101 | * ), |
||
102 | * ) |
||
103 | * ); |
||
104 | * |
||
105 | * //Search Multi query sintaxe: |
||
106 | * array( |
||
107 | * array( |
||
108 | * 'key' => 'search_key', // The key to search on |
||
109 | * 'values' => array( // The values to match with |
||
110 | * 'value_one', |
||
111 | * 'value_two', |
||
112 | * ), |
||
113 | * ), |
||
114 | * array( |
||
115 | * 'key' => 'another_key', // The key to search on |
||
116 | * 'values' => array( // The values to match with |
||
117 | * 'some_value', |
||
118 | * ), |
||
119 | * countableAttributes => array(), // For Faceted search |
||
120 | * ), |
||
121 | * ... |
||
122 | * ); |
||
123 | * |
||
124 | * </code> |
||
125 | */ |
||
126 | public function getQueries() |
||
139 | |||
140 | /** |
||
141 | * Field weights sintaxe:. |
||
142 | * |
||
143 | * <code> |
||
144 | * |
||
145 | * array( |
||
146 | * 'field_one' => 5, |
||
147 | * 'field_two' => 3, |
||
148 | * ... |
||
149 | * ); |
||
150 | * </code> |
||
151 | * |
||
152 | * @todo Implementar Query Field weights |
||
153 | */ |
||
154 | public function getFieldWeights() |
||
157 | |||
158 | /** |
||
159 | * Acesso a quantidade de itens por pagina. |
||
160 | * |
||
161 | * @return int |
||
162 | */ |
||
163 | public function getLimit() |
||
171 | |||
172 | /** |
||
173 | * Offsets the result list by the number of places set by the count;. |
||
174 | * |
||
175 | * This would be used for pagination through results, where if you have 20 |
||
176 | * results per 'page', the second page would begin at offset 20, the third |
||
177 | * page at offset 40, etc. |
||
178 | * |
||
179 | * @return int |
||
180 | */ |
||
181 | public function getOffSet() |
||
195 | |||
196 | /** |
||
197 | * Mapeamento de index SphinxSearch. |
||
198 | * |
||
199 | * @throws \InvalidArgumentException |
||
200 | * |
||
201 | * @return string |
||
202 | */ |
||
203 | public function getIndex() |
||
213 | |||
214 | /** |
||
215 | * Mapeamento de index SphinxSearch. |
||
216 | * |
||
217 | * @param string $index |
||
218 | * |
||
219 | * @throws \InvalidArgumentException |
||
220 | * |
||
221 | * @return bool |
||
222 | */ |
||
223 | public function setIndex($index) |
||
231 | |||
232 | public function setFilters(FiltersInterface $filters) |
||
240 | |||
241 | public function setFieldWeights() |
||
244 | |||
245 | public function setLimit($limit) |
||
254 | |||
255 | public function setOffSet($offset) |
||
264 | |||
265 | /** |
||
266 | * @return \Gpupo\Search\Paginator\PaginatorInterface|bool |
||
267 | */ |
||
268 | public function getPaginator() |
||
278 | |||
279 | public function setPaginator(PaginatorInterface $paginator) |
||
283 | |||
284 | public function getCountableAttributes() |
||
288 | |||
289 | /** |
||
290 | * Adiciona um atributo para contagem de resultados. |
||
291 | * |
||
292 | * Usado na busca facetada |
||
293 | * |
||
294 | * @param string $attribute |
||
295 | * |
||
296 | * @return bool |
||
297 | */ |
||
298 | public function addCountableAttribute($attribute) |
||
311 | |||
312 | /** |
||
313 | * Adiciona muitos atributos para contagem de resultados. |
||
314 | * |
||
315 | * @param array $attributes |
||
316 | */ |
||
317 | public function setCountableAttributes(array $attributes) |
||
325 | } |
||
326 |