Skip to content

Remove the $args["_post_process"] = false query argument for Media Indexed Search #136

@ernestmarcinko

Description

@ernestmarcinko

The

$args["_post_process"] = false

query argument within SearchAttachments.php was added a long time ago to prevent some compatibility issues as post processing was called separately for indexed queries. This is now not the case and should be removed.

It causes image parsing as well as advanced meta fields not to follow up. Other than a quick fix a new hierarchy should be added so that there is a separate index table search class for media files.

  • Move the postProcess function from the SearchAttachments to a Trait
  • Rename SearchAttachments to SearchMedia using the Trait
  • Create SearchMediaIndex using the Trait
  • Implement the distinction in SearchQuery.php

Final solution

No trait needed. Reversed logic, inheriting from SearchIndex first.

  1. SearchMediaIndex extends SearchIndex -> this implements the custom postProcess()
  2. SearchMedia extends SearchMediaIndex -> this implements the regular doSearch(), inherits the correctpostProcess() from SearchMediaIndex

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions