There's a lot of good code in there which can be used to get a list of field facets for any type of entity, but it's buried in a node-specific function.

An example issue where this would be helpful is #1273658: Add the ability to filter by profile fields (in the Apachesolr User module).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

David_Rothstein’s picture

Status: Active » Needs review
FileSize
883 bytes

Here's a simple patch.

andymantell’s picture

I've tested this patch via the code in #1273658: Add the ability to filter by profile fields and can confirm it is working for me. I'm reluctant to RTBC this myself as I am unsure what else it may effect, but it is working for me within this use case at any rate.

Nick_vh’s picture

in this case I would almost remove the apachesolr_default_node_facet_info and replace its references with the new function?
Otherwise you have a function that just has 2 lines

Nick_vh’s picture

Status: Needs review » Needs work
brianV’s picture

Re-rolled with improved doxygen.

I've also added a version which removes the unused $searched_info parameter from apachesolr_default_node_facet_info().

Nick_vh’s picture

Status: Needs review » Reviewed & tested by the community

I prefer the no searcher version as the var does not make sense there.

Nick_vh’s picture

Version: 7.x-1.x-dev » 6.x-3.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed to 7.x-1.x, thanks!

pwolanin’s picture

Status: Patch (to be ported) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.