Currently the Apache Solr Stats module correctly calculates facet usage, however leveraging the API functions provided by Facet API will calculate the facet usage more reliably as well as eliminate the need for the apachesolr_stats_determine_field_from_query() function.

Comments

cpliakas’s picture

StatusFileSize
new3.06 KB

The attached patch makes the changes proposed in the original post.

One important thing to note, it seems like some unused data is stored in the "filters" field, specifically the #exclude and #local properties. The patch actually changes how the data is stored so that it is an associative array of facet name / facet values. This change would effect anyone who is using the 7.x-1.x version of Apache Solr Statistics, so I am not sure how you want to handle this. As an alternative, the return value of the proposed apachesolr_stats_get_active_facets() API function could mimc the current data structure to ensure backwards compatibility.

Let me know how you want to proceed,
Chris

cpliakas’s picture

Status: Active » Needs review

Changing to "needs review".

cpliakas’s picture

Title: Leverage API functions in the Facet API module to more reliable calculate facet usage » Leverage API functions in the Facet API module to calculate facet usage more reliably

Changing grammar of title.

cpliakas’s picture

StatusFileSize
new3.06 KB

Rerolled patch against latest 7.x-1.x code.

cpliakas’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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