src/Search/Framework/IndexDocument.php
public function attachField(IndexField $field)
    {
        // Enrich the field here, agent will probably do this.

        // Throw the SearchEvents::FIELD_ENRICH event, reset the field's value
        // with the enriched value.
//        $event = new SearchFieldEvent($this->_service, $this, $field);
//        $this->_dispatcher->dispatch(SearchEvents::FIELD_ENRICH, $event);
//        $field->setValue($event->getValue());

        $id = $field->getId();
        $this->_fields[$id] = $field;

        return $this;
    }
public function attachField(IndexField $field)
    {
        // Enrich the field here, agent will probably do this.

        // Throw the SearchEvents::FIELD_ENRICH event, reset the field's value
        // with the enriched value.
//        $event = new SearchFieldEvent($this->_service, $this, $field);
//        $this->_dispatcher->dispatch(SearchEvents::FIELD_ENRICH, $event);
//        $field->setValue($event->getValue());

        $id = $field->getId();
        $this->_fields[$id] = $field;

        return $this;
    }
public function attachField ( IndexField $ field ) { // Enrich the field here, agent will probably do this. // Throw the SearchEvents::FIELD_ENRICH event, reset the field's value // with the enriched value. //        $event = new SearchFieldEvent($this->_service, $this, $field); //        $this->_dispatcher->dispatch(SearchEvents::FIELD_ENRICH, $event); //        $field->setValue($event->getValue()); $ id = $ field -> getId ( ) ; $ this -> _fields [ $ id ] = $ field ; return $ this ; }
Adds a field to the document.

This method throws the SearchEvents::FIELD_ENRICH event and stores the
enriched value as the field's value.

@param IndexField $field
The field being added to this document.

@return SearchIndexDocument
Adds a field to the document .