I'm using state_flow and Search API. When i try to publish node through node/%/revisions/%/workflow/publish the node successfully published but search API index is not updated. Search API relies on entity_update hook but it is not fired from state_flow.

It can be done in the same way as taxonomy integration implemented:
taxonomy_build_node_index($node);
in the set_published method().

And add code to call re-indexing node in Search API:

if (module_exists('search_api')) {
    search_api_track_item_change('node', array($node->nid));
}

As a temporary solution anybody can implement hook_state_flow_event_fired in own module and make the same:

function MYMODULE_state_flow_event_fired($node, $event_key, $uid, $log) {
  // Rebuild index for this node
  if (module_exists('search_api')) {
    if ($event_key == 'publish') {
      search_api_track_item_change('node', array($node->nid));
    }
  }
}

Comments

fmitchell’s picture

Assigned: Unassigned » fmitchell

Thanks for catching this. I'll assign to myself.

fmitchell’s picture

Status: Fixed » Closed (fixed)

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