I have created a custom field to the node index of apache solr. Here is the code.
function myModule_apachesolr_index_document_build_node(ApacheSolrDocument $document, $node, $env_id) {
if($node->type == "feature") {
$support = db_select("custom_table", 'a')
->fields("a", array('Support'))
->condition('nid', $node->nid)
->execute()->fetchField();
$document->addField('custom_field', $support);
}
}
And then for this custom field I have created the facet. Here is the code.
function myModule_facetapi_facet_info(array $searcher_info) {
$facets = array();
$facets['custom_abot_support'] = array(
'label' => t('Custom Facet'),
'description' => t('Filters by Support'),
'field' => 'custom_field'
);
}
The facet successfully created and it has been present in the facets list. But the problem is on the search page. When I try to search some thing, on the search results page this facet only display the title of the facet block. It does not display any content.
Any one what is the problem?