I am using this module on a site which has content types without the standard title and body fields. When these are indexed, the following error is thrown:

Notice: Undefined index: title in ApacheSolrDocument->__get() (line 313 of D:\Projects\Foo\site\www\sites\all\modules\vendor\apachesolr\Apache_Solr_Document.php).

It appears that these fields are assumed to be present. Looking at the D6 version of the module I see this:

// use language specific stemming and so on ..
if (isset($document->title)) {
  $document->{'title_' . $language} = $document->title;
}
if (isset($document->body)) {
  $document->{'body_' . $language} = $document->body;
}

has turned into this in the D7 port:

// use language specific stemming and so on ..
$document->{'title_' . $language} = $document->title;
$document->{'body_' . $language} = $document->body;

Was there any reason behind this simplification?

Comments

andymantell’s picture

Status: Active » Needs review
StatusFileSize
new1.1 KB

The attached patch simply reinstates the isset() tests from the D6 version.

andymantell’s picture

Status: Needs review » Needs work

Just looking through this patch:

http://drupal.org/files/issues/1248428-2-apachesolr_multilingual-update_...

and found that it uses this instead:

$document->{'label_' . $language} = $document->label;
$document->{'content_' . $language} = $document->content;

Not sure which is right now...

firebird’s picture

Status: Needs work » Needs review
StatusFileSize
new9.04 KB

Since the latest version of ApacheSolr uses "label" and "content", I'm guessing Multilingual should follow suit.

Here's a patch that does the necessary changes to apachesolr_multilingual. It also includes patch 1248428-2. The rest of the changes in the patch have to do with trying to get multilingual compatible with SOLR 3.4.

With these changes, I seem to manage to run SOLR search, index site content and do searches without huge lists of error messages.

mkalkbrenner’s picture

Status: Needs review » Closed (duplicate)