Not able to search through attachment contents

Please format your code using </> icon as explained in this guide. It will make your post more readable.

Can you see any "type": "attachment" in your mapping? I don't see any.
That's your problem as I said before.