Facet API is introducing dependency plugins as a means to solve the issue #551620: Type dependent facet blocks. Apache solr will have to associate the correct plugins with the various fields in order to utilize the new functionality.

Comments

cpliakas’s picture

Status: Needs review » Active
StatusFileSize
new1.36 KB

The attached patch integrates with the dependency plugin system. Marking as needs review, however this can wait until the dependency-551620 feature branch has been merged back into the 7.x-1.x branch. If we wanted to jump the gun and committed it now, it wouldn't break anything.

cpliakas’s picture

Status: Active » Needs review
cpliakas’s picture

Status: Active » Needs review

This dependency feature branch has been merged into the main 7.x-1.x branch of Facet API, and this patch is still valid.

cpliakas’s picture

StatusFileSize
new1.42 KB
pwolanin’s picture

re:

'dependency plugins' => $field_info['dependency plugins'],

So facetAPI altering the field info, or that needs to come back from the apachesolr hook invocation?

cpliakas’s picture

Since Apache Solr is defining the fields, Apache Solr is responsible for associating the dependency plugins with the fields. Only it knows the types of fields it is defining, and when they get to Facet API is has no concept of where the underlying data came from.

cpliakas’s picture

Issue tags: +Facet API integration

Changing tag so we can more accurately track Facet API integration issues.

cpliakas’s picture

Status: Needs review » Needs work

I added the "role" dependency so that users can configure which roles can see certain facets at 5b07200. I am marking as "needs work", because I am thinking that all fields should have the "role" and "bundle" dependency plugins. Reading up on progressive disclosure, I think that we should give administrators as much flexibility as possible configure the conditions that expose facets.

cpliakas’s picture

Status: Needs work » Needs review
StatusFileSize
new1.06 KB

Re-rolled patch with support for the "role" dependency plugin. Added both "bundle" and "role" dependency plugins to all fields, since it will give users maximum amount of configuration in terms of which facets are displayed to the user when.

pwolanin’s picture

Looks like a very minimal change - though what do you need the field name for?

cpliakas’s picture

The name serves a couple of purposes. First, it tells you what field you are dealing with so you can load the definition and get information such as the bundles the field is attached to. This is important for the "A content type this field is attached to must be active." setting. I'm sure this information will be useful in other cases that we haven't thought of yet as well. Second, it tells you whether or not a field is a Field API field. In cases such as the nid, the "A content type this field is attached to must be active." setting wouldn't make sense so it knows to not display the option. Without this key, neither would be possible without more complex logic.

pwolanin’s picture

Status: Needs review » Fixed

committed.

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