Custom facets return no results on search page
I have found the solution.


if you wrote this hook hook_apachesolr_index_document_build_node then
you have to delete the indexed data from apache solr search index and
then reindex all the data. if you only reindex data then it will not
work.
and 2nd point. you have to keep care of the prefixes of the field. if it is a single string then use ss if multivalue field then use sm
3rd point is you have to call hook_apachesolr_query_alter.

function myModule_apachesolr_query_alter($query){
   $query-&gt;addParams(array('fl' =&gt; array('ss_custom_field')));


}