Based of the terrific guidance provided in this blog post we have built a faceted directory of our business members using CiviCRM Entity, Search API, and Facet API.
To accomplish this, we have created an index of the CiviCRM Membership entity which we connect to the member's contact info and some custom fields through Search API's "Related Fields" functionality. This approach is described in the comments to the aforementioned blog post.
The directory is functioning, but we have experienced a couple of issues
- New CiviCRM Memberships aren't getting indexed; and
- Updated CiviCRM Memberships aren't getting marked as requiring re-indexing.
If we manually re-index the entire index, the changes to the updated CiviCRM Memberships get picked up, but the new CiviCRM Memberships still don't get indexed. In order to get the new CiviCRM Memberships indexed, we have to disable the index and then re-enable it. In the short term, these workarounds work, but would like to figure out what the issue is.
Also, in attempting to set up Rules to re-index items when "related fields" are updated (as described in the Search API documentation), we've noticed that we're not able to access the CiviCRM Membership entity to apply Search API's re-indexing action.
So, would be grateful to hear if anyone has run into similar problems (and hopefully any solutions), or if anyone has thoughts on where to start looking for a solution.