forked from jreinke/magento-elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSearchable.php
43 lines (41 loc) · 988 Bytes
/
Searchable.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
<?php
/**
* Elastica searchable interface
*
* @category Xodoa
* @package Elastica
* @author Thibault Duplessis <thibault.duplessis@gmail.com>
*/
interface Elastica_Searchable
{
/**
* Searches results for a query
*
* TODO: Improve sample code
* {
* "from" : 0,
* "size" : 10,
* "sort" : {
* "postDate" : {"reverse" : true},
* "user" : { },
* "_score" : { }
* },
* "query" : {
* "term" : { "user" : "kimchy" }
* }
* }
*
* @param string|array|Elastica_Query $query Array with all query data inside or a Elastica_Query object
* @return Elastica_ResultSet ResultSet with all results inside
*/
public function search($query);
/**
* Counts results for a query
*
* If no query is set, matchall query is created
*
* @param string|array|Elastica_Query $query Array with all query data inside or a Elastica_Query object
* @return int number of documents matching the query
*/
public function count($query = '');
}