Sorry if this has been asked (and answered) before.

I'm trying to get DS to group my search results by type. I'm using Media and File Entity and Solr indexes images, videos (youtube references) and articles (nodes).

DS groups the search result and manages to group articles and image files as it should. Videos on the other hand fall under the category Other. Ideally, I'd like to specify wrapper and title on the GROUP BY TYPE SETTINGS area on the DS admin for search results.

I guess I'm missing something blatantly obvious somewhere but please, a hint?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cato’s picture

This is a solution for my specific problem only and probably carries multiple dependencies (such as for Entity file) and possible the plague as well.
To allow DS to group by more types than just nodes (Solr can index files also), one has to query Entity file for all possible file types (bundle names) to include in the grouping.

Line 127 in ds_search.admin.inc

  $node_types = node_type_get_names();

Changes to

  $node_types = node_type_get_names();
  $node_types = array_merge($node_types,file_entity_type_get_names());

Now, this is not a clean solution and not something I would recommend to anyone unless it gets the blessing of the DS developers / maintainers. But it seems to do the trick in my specific situation.

Please disregard attached patch as it contains an error.

cato’s picture

Ignore previous patch. Rolled a better patch that actually checks if requisite functions exist before appending the file types to the $node_types array.
Still might carry the plaque or ebola though.

cato’s picture

Category: support » feature

Changed Category from support request to feature request

aspilicious’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Thnx for the patch but I'm not accepting feature requests for Drupal 7 anymore.