On a site with multiple file fields I had nodes associated with search results that were not having the file field. On debugging I found the problem to be an array_merge_recursive in _apachesolr_attachments_get_all_files. PHP version is 5.3.3.

Comments

nick_vh’s picture

That's possible, it was still very much a development version.
Are you able to fix it and post a patch on the correct behavior?

Thanks!

stefan freudenberg’s picture

Here's a patch that correctly indexes the entity-file-relationship for multiple attachment fields.

stefan freudenberg’s picture

Status: Active » Needs review

Forgot to set the status.

heacu’s picture

i had just noticed the problem myself, and was going to post a patch, too.

actually, the one above didn't work for me. changing the solr_reindex function was enough: if, for example, a node (with nid=545, for example) had two file fields with files to be indexed, array_merge_recursive would, when confronted with identical numeric keys, simply append 545 to the end, for example making it key 546. so making the change in the solr_reindex function did the trick.

here's the patch that worked for me.

heacu’s picture

actually let me clarify that for me, the above patch was needed for nodes that have multiple file fields, each of which have indexable files. i guess that's what the first poster was after as well.

nick_vh’s picture

Status: Needs review » Reviewed & tested by the community

I'll commit the latter solution. If anyone would ever encounter another problem in regards with the merge code, please re-open

nick_vh’s picture

Status: Reviewed & tested by the community » Fixed

Committed to D7 branch

Status: Fixed » Closed (fixed)

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