Свойство | Тип | Описание | |
---|---|---|---|
$fullTextSearch | |||
$geo | bool | ||
$includeRowCount | int | ||
$keyValuePairs | |||
$limit | otherwise comma-delineated list of fieldnames | ||
$offset | int | ||
$rowFilters | Holds all row filters for this Query. Implicit top-level AND. | ||
$selectFields | string | ||
$sorts | Holds all results sorts for this Query. Example contents: "$distance:desc","name:asc","locality:asc" | ||
$threshold | misc key-value pairs added as additional parameters |
Метод | Описание | |
---|---|---|
_and ( $queries ) | Used to nest AND'ed predicates. | |
_or ( $queries ) | Used to nest OR'ed predicates. | |
add ( $filter ) : void | Adds filter object to this Query. | |
addParam ( $key, $value ) | Adds misc parameters to the URL query | |
at ( $point ) : this | Adds a filter so that results can only be obtained at a specified point | |
field ( $field ) : obj | Begins construction of a new row filter for this Query. | |
getResponseType ( ) | ||
getSelectFields ( ) : array | ||
includeRowCount ( ) : this | The response will include a count of the total number of rows in the table that conform to the request based on included filters. There is a performance hit. | |
limit ( $limit ) : this | Sets the maximum amount of records to return from this Query. | |
offset ( $offset ) : obj | Sets how many records in to start getting results (i.e., the page offset) for this Query. | |
only ( $fields ) : this | Sets the fields to select. This is optional; default behaviour is generally to select all fields in the schema. | |
search ( $term ) : obj | Sets a full text search query. Factual will use this value to perform a full text search against various attributes of the underlying table, such as entity name, address, etc. | |
select ( $fields ) : this | Sets the fields to select. This is optional; default behaviour is generally to select all fields in the schema. | |
setIncludeRowCount ( boolean $includeRowCount ) : this | When true, the response will include a count of the total number of rows in the table that conform to the request based on included filters. | |
sortAsc ( $field ) : obj | Sets this Query to sort field in ascending order. | |
sortDesc ( $field ) : this | Sets this Query to sort field in descending order. | |
threshold ( $threshold ) | ||
toString ( ) | ||
toUrlQuery ( ) : string | Builds and returns the query string to represent this Query when talking to Factual's API. Provides proper URL encoding and escaping. | |
within ( $geo ) : this | Adds a filter so that results can only be (roughly) within the specified geometry. |
Метод | Описание | |
---|---|---|
fieldsJsonOrNull ( ) | ||
geoBoundsJsonOrNull ( ) | ||
popFilters ( $op, array $queries ) : obj | Pops the newest Filter from each of queries, grouping each popped Filter into one new FilterGroup. | |
rowFiltersJsonOrNull ( ) | ||
sortsJsonOrNull ( ) | ||
thresholdOrNull ( ) |
public at ( $point ) : this | ||
Результат | this | Query. |
public field ( $field ) : obj | ||
Результат | obj | QueryBuilder A partial representation of the new row filter. |
public getSelectFields ( ) : array | ||
Результат | array | of select fields set by select(), null if none. |
public includeRowCount ( ) : this | ||
Результат | this | Query, marked to return total row count when run. |
public limit ( $limit ) : this | ||
Результат | this | Query |
public offset ( $offset ) : obj | ||
Результат | obj | this Query |
public only ( $fields ) : this | ||
Результат | this | Query |
The FilterGroup's logic will be determined by op.
protected popFilters ( $op, array $queries ) : obj | ||
$queries | array | |
Результат | obj | queries Query object |
public search ( $term ) : obj | ||
Результат | obj | Query |
public select ( $fields ) : this | ||
Результат | this | Query |
public setIncludeRowCount ( boolean $includeRowCount ) : this | ||
$includeRowCount | boolean | |
Результат | this | Query. |
public sortAsc ( $field ) : obj | ||
Результат | obj | this Query |
public sortDesc ( $field ) : this | ||
Результат | this | Query |
Example output:
filters=%7B%22%24and%22%3A%5B%7B%22region%22%3A%7B%22%24in%22%3A%22MA%2CVT%2CNH%22%7D%7D%2C%7B%22%24or%22%3A%5B%7B%22first_name%22%3A%7B%22%24eq%22%3A%22Chun%22%7D%7D%2C%7B%22last_name%22%3A%7B%22%24eq%22%3A%22Kok%22%7D%7D%5D%7D%5D%7D
(After decoding, the above example would be used by the server as:)
filters={"$and":[{"region":{"$in":"MA,VT,NH"}},{"$or":[{"first_name":{"$eq":"Chun"}},{"last_name":{"$eq":"Kok"}}]}]}
public toUrlQuery ( ) : string | ||
Результат | string | The query string to represent this Query when talking to Factual's API. |
public within ( $geo ) : this | ||
Результат | this | Query. |
protected $rowFilters |
protected $sorts |