In my current project i need to index all e-mails and their attachments from multiple mailbox.
I will use Solr and I don't know what is the best approach to build my index's structure. My first approach was:
<fields>
<field name="id" require="true"/>
<field name="uid" require="true"/>
//A lot of other fields
<dynamicField name="attachmentName_*" require="false">
<dynamicField name="attachmentBody_*" require="false">
</fields>
But now i am not really sure if it is the best structure. I think i can't search for one term (e.g stackoverflow) and know where was the term (e.g. *attachmentBody_1* or *2 or *3 etc) with a single query.
Anyone have a better suggestion to my index's structure?