If I could understand, it is not possible to use Facets directly with Attachment files or in other words to define Facets to Attachment files. It's possible to define Facets to the Parent Nodes, but this doesn't be enough if someone wants to filter pdf files, because solr filters only Nodes but not attachment files. Is there a plan to define Facets directly to Attachments or is there any other method to achieve this.

I attached an Image that shows what I mean. In this example, I search a word "Dorf", solr finds and returns 5 attachment files and 2 Nodes, but returns only Facets for these 2 Nodes.

thank you for your answer.

CommentFileSizeAuthor
solr attachments.png64.17 KBduygu

Comments

nick_vh’s picture

If you want facets you should define the facetapi_info for those. It's part of the API. The apachesolr attachments module does provide some basic fields such as :

'ss_filemime', 'ss_file_entity_title', 'ss_file_entity_url'

To create facets for them :


function mymodule_facetapi_facet_info($searcher_info) {
  $facets = array();

  $facets['ss_filemime'] = array(
    'field' => 'ss_filemime',
    'label' => t('File Type'),
    'description' => t('Filter by File Type'),
  );
  return $facets;
}

We should probably add that to the module
justluvgod’s picture

I have the same dilemma. Is this something that could be added to the module as you suggested? I would be happy to test.. Admittedly, I am not good at programming, but would like this feature.