Whoa there, do you mean attachment content? As in what the files contain? I am not sure I view that as within the scope of Discourse.
Search should match filenames, if your filenames are unique enough, because the filenames are part of the post body. But the contents of the files are not considered part of the Discourse posts..