-
Notifications
You must be signed in to change notification settings - Fork 27
/
FacetQuery.php
36 lines (30 loc) · 884 Bytes
/
FacetQuery.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
<?php
namespace Factual;
/**
* Represents a top level Factual facet query. Knows how to represent the facet
* query as URL encoded key value pairs, ready for the query string in a GET
* request. (See {@link #toUrlQuery()})
*
* @author tyler
*/
class FacetQuery extends FactualQuery {
const RESPONSETYPE = "FacetResponse";
/**
* Constructor.
* @param string fields fields for which facets will be generated
*/
public function __construct($fields) {
return $this->only($fields);
}
/**
* For each facet value count, the minimum number of results it must have in order to be
* returned in the response. Must be zero or greater. The default is 1.
* @param int count Min count for each facet
* @return obj this FacetQuery
*/
public function minCountPerFacet($count) {
$this->addParam("min_count",$count);
return $this;
}
}
?>