<?php

final class SemiStructuredObjectInstanceFulltextEngine
  extends PhabricatorFulltextEngine {

  protected function buildAbstractDocument(
    PhabricatorSearchAbstractDocument $document,
    $instance) {

    $document->setDocumentTitle($instance->getName());

    $document->addField(
      PhabricatorSearchDocumentFieldType::FIELD_BODY,
      $instance->getDescription());

    // TODO raw data?


    $document->addRelationship(
      'clss',
      $instance->getClassPHID(),
      SemiStructuredObjectTypePHIDType::TYPECONST,
      PhabricatorTime::getNow());
    }
}
