Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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?
Comment | File | Size | Author |
---|---|---|---|
#1 | ds-ds_search-morefiletypes.patch | 923 bytes | cato |
#2 | 123456-ds_search_admin-fixformorefiletypes.patch | 844 bytes | cato |
Comments
Comment #1
cato CreditAttribution: cato commentedThis 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
Changes to
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.
Comment #2
cato CreditAttribution: cato commentedIgnore 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.
Comment #3
cato CreditAttribution: cato commentedChanged Category from support request to feature request
Comment #4
aspilicious CreditAttribution: aspilicious commentedThnx for the patch but I'm not accepting feature requests for Drupal 7 anymore.