Following #2014149: Deleting the attachment index and reindexing doesn't pick up all files...
When indexing a multilingual file field - one that uses entity translation - the file only gets indexed for one language.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | apachesolr-attachments-2606214-5-multilingual-files-missing.patch | 7.17 KB | milesw |
Comments
Comment #2
milesw commentedIt seems _apachesolr_attachments_get_all_files() is not actually collecting all files because of the way results get collected in ApachesolrAttachmentsEntityFieldQuery.
Here is a patch.
Comment #3
milesw commentedHmm, I think the changes in patch #2 are unnecessary. Those changes addressed files missing after reindexing, which has already been resolved in the latest dev.
This patch addresses files missing from the index after saving and updating entities.
The field_attach_OP hooks have been refactored so that:
- All field languages are accounted for (previously field_get_items() was just getting the current/default language)
- Files no longer associated with an entity get cleaned from the index
- Some redundant code gets removed
Comment #4
milesw commentedSmall fix to avoid query exceptions.
Comment #5
milesw commentedI should know better than to post patches before thoroughly testing. This one should be good.
Comment #6
dariogcode commentedPatch #5 apply clean to 7.x-1.4, also fix issue #1563478: Deleted attachments not being removed from index. Thanks!
Comment #7
vistree commentedThis patches fixes parts of my problems. But I still have a problem with documents being attached to an old revision (compare with https://www.drupal.org/node/2263267). Can this patch help remove files from index if they are NOT attached to the current revision. Maybe important: I use workbench moderation to handly drafts of a node.