public function ApacheSolrFacetapiGeo::build in Apache Solr Search 8
Same name and namespace in other branches
- 6.3 plugins/facetapi/query_type_geo.inc \ApacheSolrFacetapiGeo::build()
- 7 plugins/facetapi/query_type_geo.inc \ApacheSolrFacetapiGeo::build()
Initializes the facet's build array.
Return value
array The initialized render array.
File
- plugins/
facetapi/ query_type_geo.inc, line 70
Class
- ApacheSolrFacetapiGeo
- Plugin for "apachesolr_geo" query types.
Code
public function build() {
$build = array();
if ($response = apachesolr_static_response_cache($this->adapter
->getSearcher())) {
if (isset($response->facet_counts->facet_queries)) {
foreach ($response->facet_counts->facet_queries as $value => $count) {
// Skip zero results values.
if ($count > 0) {
$build[$value] = array(
'#count' => $count,
);
}
}
}
}
return $build;
}