Good day.

Now I try to add extra fields to index and then search in those fields but it doesn't work.

function inti_build_publication_document(&$document, $node, $namespace) {
  if (!empty($node->field_author_org)) {
    $author_org_collection = entity_load('field_collection_item', array_map(function($n) { return $n['value']; }, $node->field_author_org['und']));
    foreach ($author_org_collection as $author_org) {
      if (!empty($author_org->field_author)) {
        foreach ($author_org->field_author['und'] as $author) {
          $author = node_load($author['nid']);
          // Here I try to add author's name to publication's index
          $document->addField('sm_author', $author->title);
        }
      }
    }
  }
}

After adding all fields to $document I write it to file, then in file I can see that all of the fields wrote successfully.
For example to publication "Creating computer using nuclear reactor" I added author "Petrov Max", and when I enter "Petrov Max" to the search field I can't see my publication. What I did wrong?
Thanks for support.
Sorry for probably bad English.

Comments

Georgique’s picture

Sorry for remind, but are there any thoughts about my trouble?

Georgique’s picture

Status: Active » Closed (duplicate)

Closing as duplicate.
http://drupal.org/node/1516428