Add new comment

Posted on by Steve N (not verified).

Is there a trick to getting the update_index hook to work? I created a custom module hook but it's not getting called and I can't figure out why...

function mysearch_apachesolr_update_index(&$document, $node) {
if (! $document) {
return;
}

switch ($node->type) {
case 'author':
$document->addField('sm_field_author_first_name', 'xxx');
$document->addField('sm_field_author_last_name', 'yyy');
break;

case 'book':
$document->setMultiValue('sm_field_book_id', 'zzz');
break;
}
}

Any ideas? Thanks!

Steve

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

Filtered HTML

  • Use [acphone_sales], [acphone_sales_text], [acphone_support], [acphone_international], [acphone_devcloud], [acphone_extra1] and [acphone_extra2] as placeholders for Acquia phone numbers. Add class "acquia-phones-link" to wrapper element to make number a link.
  • To post pieces of code, surround them with <code>...</code> tags. For PHP code, you can use <?php ... ?>, which will also colour it based on syntax.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <h4> <h5> <h2> <img>
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.