Problem/Motivation

File replacement in media should trigger reindex in entities referencing that media file.

Steps to reproduce

- When node of type X is created/updated with media entities referenced, everything works as expected.
- If I edit the media entity Y that is referenced in a node, the node doesn't get re-indexed because it doesn't know that something changed.

Proposed resolution

I'm not sure what's a proper resolution; but right now I'm proposing to add a hook after text extraction works to fix this in custom code.

For proper resolution I guess we could update the search_api_attachments key_value rows and add the entities that reference the extracted file (not only media but the entities that reference the media)

Remaining tasks

- Ensure issue makes sense
- Provide patch
- Test
- Commit

User interface changes

Nothing

API changes

New hooks to be added

Data model changes

None if we go only with the hooks.

New data will be added if we go with a proper solution as explained above.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

kporras07 created an issue. See original summary.

izus’s picture

this makes sens
thanks for catching it

kporras07’s picture

Status: Active » Needs review

I just added a MR that introduces the new hook https://git.drupalcode.org/project/search_api_attachments/-/merge_reques... :)

  • izus committed 0eec147 on 8.x-1.x authored by kporras07
    Issue #3205272 by kporras07, izus: Add a hook after content extraction...

  • kporras07 authored 642a6b3 on 9.0.x
    Issue #3205272 by kporras07, izus: Add a hook after content extraction...
izus’s picture

Status: Needs review » Fixed

GG
this is now merged to 8 and 9 branches
Thanks a lot

Status: Fixed » Closed (fixed)

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