It requires you to "assign" the attachment to a topic, which is used as TOPIC_URL for permission purposes. In addition you may set another MidgardObject as source object, its GUID is stored in the __SOURCE field of the index.
The documents type is "midcom_attachment", though it is not derived from midcom for several reasons directly. They should be compatible though, in terms of usage.
$document = new midcom_services_indexer_document_attachment($attachment, $object); $indexer->index($document);
Where $attachment is the attachment to be indexed and $object is the object the object is associated with. The corresponding topic will be detected using the object's GUID through NAP. If this fails, you have to set the members $topic_guid, $topic_url and $component manually.
|todo||More DBA stuff: use DBA classes, which allow you to implicitly load the parent object using get_parent.|
\MidgardAttachmentThe Attachment to index.
\MidgardObjectThe source objece to which the attachment is bound.
If this fails, you have to set the members $topic_guid, $topic_url and $component manually.