The more I think about it, the less sure I am that we are currently doing this the right way. The Search API is a generic framework, and none of the Facet API-specific code it currently contains really needs to be directly in it, instead of in a custom module.
Putting this in its own module would:
- Solve the depency more nicely.
- Make the code cleaner again (no mix between framework and Facet API integration).
- Remove (probably minor) performance drawbacks for people not using the Facet API.
- Demonstrate that such major improvements are possible from contrib modules, like the current Facets module does.

Does any of you disagree with this, or have some counter-arguments?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drunken monkey’s picture

New module would probably go into contrib/search_api_facetapi.
Or would it maybe even be better to replace the old Facets module with this? (OK, probably not, but it would have its advantages …)

drunken monkey’s picture

Status: Active » Needs review
FileSize
65.38 KB

This would make the change, reviews would be appreciated.
There is already code committed for the search_api_facets module taking this into account, and a rough skeleton for the search_api_facetapi module.

cpliakas’s picture

The overall approach makes sense to me. Will download and test.

drunken monkey’s picture

Please don't, yet. Sorry for posting it in this state, I didn't test it at all. Now there are the silliest mistakes, like wrong menu definitions, etc.

drunken monkey’s picture

Status: Needs review » Needs work
drunken monkey’s picture

Status: Needs work » Needs review
FileSize
65.42 KB

OK, this is much more like it.
Sorry again for the untested previous patch!

drunken monkey’s picture

Status: Needs review » Fixed

As everything seems to work: committed.

Status: Fixed » Closed (fixed)

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