facets appear "_empty_" I'm using the Apache Solr Search Integration and Facet API modules. I'm trying to implement facets for custom fields publication_date, publication_author, and journal, which are part of the content type publication.

These 3 fields are indexed successfully as ss_date, ss_author, and ss_journal. Furthermore, I can search against these fields on the default apachesolr search page. However, the facets for these fields show up as "_empty_". For example, when the search page loads, under the "publication_author" facet header, one bullet item shows up as "_empty_ (10)", which to me means that the author field is being indexed successfully with value "NULL" or possibly literally "_empty_" for all 10 publication nodes. Code is below for just the author facet.

define custom facets

function HOOK_facetapi_facet_info(array $searcher_info) {
    $facets = array();
    // Facets are usually associated with the type of content stored in the index.
    if (isset($searcher_info['types']['node'])) {
        $facets['ss_author'] = array(
            'name' =&gt; 'ss_author',
            'label' =&gt; t('custom: author'),
            'description' =&gt; t('Shows the authors'),
            'field' =&gt; 'ss_author',
            'dependency plugins' =&gt; array('role'),
            'default widget' =&gt; 'links',
            'allowed operators' =&gt; array(FACETAPI_OPERATOR_AND =&gt; TRUE, FACETAPI_OPERATOR_OR =&gt; TRUE),
            'facet missing allowed' =&gt; FALSE,
            'facet mincount allowed' =&gt; FALSE,
            //'map callback' =&gt; 'not used for now',
            'max callback' =&gt; FALSE,
            'default sorts' =&gt; array(
                array('active', SORT_DESC),
                array('count', SORT_DESC),
                array('display', SORT_ASC),
            ),
        );
    }
    return $facets;
}


"ss_author" is the name of the field added to the ApacheSolr document during indexing. If you'd like the code used to actually index these fields, let me know. Thanks very much!
Facets, by their very nature, work best when you use them for 'select' type fields, not pure text.  Facets work very well - and automatically - with taxonomy terms for example, because terms are re-used and it's easy to group based on select type fields.

Whenever I've wanted to use custom fields as facets, I've implemented them as terms (tagging) or select fields, and then they work properly.

So, I'm wondering - is that something you could do?  Rather than setting up your fields as 'text', could you set them up as select-type fields (whether it's tags, which don't have to be predetermined or select options which you have to enter in advance)?  That type of field is easier to GROUP by - which is what facets are really doing.

It may not be an option, but I have a feeling that would resolve your issue.

Let us know how this gets resolved!