Answers.Body: <p>The module Civicrm Entity Search API which comes with CiviCRM Entity now supports this, as of 2.0-beta10. Russ took my comment and contributed back to the project. Thanks Russ!</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-01T18:33:17.300Z
Answers.Text: Good on you both
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-01T18:09:36.473Z
Answers.LastActivityDate: 2017-10-01T18:09:36.473Z
Answers.UserDisplayName: jackrabbithanna
Body: <p>Based of the terrific guidance provided in this <a href="https://civicrm.org/blog/jackrabbithanna/civicrm-entity-using-drupal-search-and-facet-apis-with-civicrm-data" rel="nofollow noreferrer">blog post</a> we have built a faceted directory of our business members using CiviCRM Entity, Search API, and Facet API.</p>
  
  <p>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.</p>
  
  <p>The directory is functioning, but we have experienced a couple of issues</p>
  
  <ol>
  <li>New CiviCRM Memberships aren't getting indexed; and</li>
  <li>Updated CiviCRM Memberships aren't getting marked as requiring re-indexing.</li>
  </ol>
  
  <p>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.</p>
  
  <p>Also, in attempting to set up Rules to re-index items when "related fields" are updated (as described in the <a href="https://www.drupal.org/docs/7/modules/search-api/getting-started/common-pitfalls#indirect-changes" rel="nofollow noreferrer">Search API documentation</a>), we've noticed that we're not able to access the CiviCRM Membership entity to apply Search API's re-indexing action.</p>
  
  <p>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.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-31T19:03:12.683Z
Comments.Text: it may be worth making a purely drupal search API view using nodes and confirm if this is purely a Search API set up problem rather than one specific to civi data
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-09-09T06:07:51.810Z
Comments.Text: I added a submodule to civicrm entity, search api extras. It provides handling for updates to the search index for contacts. The code just needs to be added to for memberships. Ping jackrabbithanna in civicrm entity channel at chat.civicrm.org
Comments.UserDisplayName: jackrabbithanna
Tags: <civimember><search><drupal-views><civicrm-entity>
Title: How to get new or updated CiviCRM entities (Memberships) indexed by Drupal Search API?
ThreadText: # How to get new or updated CiviCRM entities (Memberships) indexed by Drupal Search API?
  
  (Asked by: username_0 on 2017-08-31)
  
  Based of the terrific guidance provided in this [blog post](https://civicrm.org/blog/username_2/civicrm-entity-using-drupal-search-and-facet-apis-with-civicrm-data) 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
  
  1. New CiviCRM Memberships aren't getting indexed; and
  2. 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](https://www.drupal.org/docs/7/modules/search-api/getting-started/common-pitfalls#indirect-changes)), 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.
  
  **Tags:** civimember, search, drupal-views, civicrm-entity
  
  > **Comments:**
  > **username_1**: it may be worth making a purely drupal search API view using nodes and confirm if this is purely a Search API set up problem rather than one specific to civi data  
  > **username_2**: I added a submodule to civicrm entity, search api extras. It provides handling for updates to the search index for contacts. The code just needs to be added to for memberships. Ping username_2 in civicrm entity channel at chat.civicrm.org  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2017-10-01. Score: 1 | Accepted answer
  
  The module Civicrm Entity Search API which comes with CiviCRM Entity now supports this, as of 2.0-beta10. username_0 took my comment and contributed back to the project. Thanks username_0!
  
  > **Comments:**
  > **username_1**: Good on you both  
  
  ---
  
  