Hi @ilocimwca
It's simple to do with this addon
https://fulltextsearch.org/wpfts-addon-files-only-1.0.1.zip
It contains some code to limit post_type to 'attachment' only:
add_action('pre_get_posts', function(&$wpq)
{
if ($wpq->is_search && $wpq->is_main_query()) {
$wpq->set('post_type', array('attachment'));
$wpq->set('post_status', array('inherit'));
}
});
Pretty simple. If you want to set up your own post_types, just modify this code. You can read about full WP_Query() parameters at the Wordpress official documentation.