Spotlight search attachments

What is the extent of Spotlight search on OO documents? Does Spotlight find the OO document’s attachments? Or does Spotlight at least find the OO document where the attached document was hit on?

If you’re searching for the filename of the embedded attachment, then Spotlight will find the oo5 document that contains it. If you’re searching for text within the attachment, Spotlight doesn’t seem to find it.

Apparently, something like this gets added to the under-the-hood contents and is perhaps what Spotlight sees. Note that this probably changes depending on file types and other things. It seems complicated (at least to me).

<attachment id="att0" href="attachments/filename.pdf" type="com.adobe.pdf"/>

The attachment itself may be stored inside the oo5 package (or it may be as data in the contents.xml), and I don’t think that Spotlight ever considers any internal package file to be a ‘result’. So as far as I can tell, your second outcome is the correct one.