Closed (fixed)
Project:
Search API attachments
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
21 Jul 2017 at 10:05 UTC
Updated:
24 Mar 2020 at 17:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jeroen.b commentedHere's a patch.
Comment #3
jeroen.b commentedSorry, forgot to fix the labels, here's an updated patch.
Comment #4
kholloway commentedI am using this patch and it seems to work for indexing files that are nested in media type reference fields on the node. I will update if I discover anything that needs improving.
Comment #5
dakku commented++
Comment #6
Anonymous (not verified) commentedUsing this patch to index files attached via paragraphs, seems to work great, thanks.
Comment #7
George Bills commentedWorks for me, it indexes files attached through media fields. I had to add field_attachments:entity:field_media_file to my index first, then add fields again, then add "saa_file_property" and check the field. @izus any chance of this patch getting rolled into an official release? With media in core now I think it's going to slowly become the "default" for adding files to entities.
Comment #8
izus commentedhi,
Thanks for the suggested patch
i rebased the #3 patch as it was no longer applying.
Here is the rebased patch with no additions. juste a rebase of #3
i'll add the result of my manual test in a separate comment.
Comment #9
izus commentedHi again,
i tried to evaluate the patch manually before reviewing the code. so i followed the SIMPLE USAGE EXAMPLE section of the readme.
before the patch : it worked like a charm
after applying the patch, it stucks in the 8 step : when trying to add the Search API attachments (saa_file_property) field to the index, the form has an empty required checkboxes field. so the submit can't be passed.
EDIT : as a user, i would hope that required checkboxes field would suggest a list of file fields and media file fields that i want to be indexed
Comment #10
izus commentedas new commits were merged
here is a rebase of the existing patch FWIW but i don't think at now we can use it (explaining in the next comment)
Comment #11
izus commentedi tested the patch in #10 and the result is the same as in #9
we can't go this way as it breacks the work done so far (see #9 for details)
i'm changing this issue title to "Support media module" and setting it back to active
Comment #13
izus commentedHi
i pushed a commit to handle media file fields.
actually this is working and it supports (for now) the field_media_file media field (this is the default one in media)
search api attachments is now able to add a choice to index this file :)
Thanks all
ps : i'm not going to create a release for this right now, i'll let some weeks pass so that people can test
Comment #14
cirrus3d commentedHi,
How easy could it be to create a D7 version of this patch?
Thank you
Comment #16
marco-sHi izus
Thank you very much for this media support. As you said, it currently only supports the default media bundle 'file'. We should add a validation for this in the code, because in my case I have a mixed media field (file bundle and a custom link bundle) which causes an error due the link bundle.
Recommended solution:
Comment #17
izus commentedpushed a commit to adress #16
please feel free to reopen the issue or create a new one if you have another feedback. Also thanks for testing this feature and contributing
Comment #18
netsliverindexing error if media is null
Comment #19
izus commentedmerged #18 Thanks
Comment #20
pcate commentedJust an FYI that the "file" media entity type might be renamed to "document": https://www.drupal.org/project/drupal/issues/3019202 in a future core version, so support for other types might become more important.
Comment #21
stefdewa commentedI already use media bundle 'Document' instead of 'File'. Attached patch changes only this. This should not be merged in dev because it will break the site of people who have media bundle 'File'. I only upload this for people who already use bundle 'Document'.
Comment #22
Anonymous (not verified) commentedAbove patch no longer applies. Created a new one that supports both "file" and "document" bundle.
Comment #23
izus commentedComment #24
Anonymous (not verified) commentedJust found this https://www.drupal.org/project/search_api_attachments/issues/3048673 so that renders my patch useless.