This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Attachment search not working correctly

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Attachment search not working correctly Reply To: Attachment search not working correctly

#25561
Ernest MarcinkoErnest Marcinko
Keymaster

Hi Rees,

Thank you for all the details, it helps us a lot.

Okay, so I checked the given posts and their attachments, and I see the problem. The given images are not actually attached to that post, but only used in their contents. You can check that this way:
– Open the post editor and click “Add Media”: https://i.imgur.com/MKESsrz.png
– Click the Media library: https://i.imgur.com/GgjOGvj.png
– Change “Uploaded to this”: https://i.imgur.com/ZkMVhlx.png
As you can see, there is only one image attached to the post, when searching that image name, the post is returned as it should.

When the plugin indexes the attachments, it checks the database for the attachment parents, but in this case their parents are not defined in the database, because they are not attached to any post, but simply uploaded as images (or the parent was deleted).
Unfortunately currently there is no way of getting in which post was the attachment image used, as the post contents does not contain a connection between the image object, only the image URL.

I am not sure if there is a way to natively change the attachment parent IDs via editor, but there might be plugins out there for this purpose.