Closed (duplicate)
Project:
Apache Solr Search
Version:
7.x-1.0-beta16
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
27 Mar 2012 at 14:37 UTC
Updated:
9 Apr 2012 at 08:27 UTC
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
Comment #1
Georgique commentedSorry for remind, but are there any thoughts about my trouble?
Comment #2
Georgique commentedClosing as duplicate.
http://drupal.org/node/1516428