/** * Implements SearchEngineAbstract::indexDocument(). * * @param CollectionAbstract $collection * @param IndexDocument $document */ public function indexDocument(CollectionAbstract $collection, IndexDocument $document) { $index_doc = array(); if (null !== ($boost = $document->getBoost())) { $index_doc['_boost'] = $boost; } foreach ($document as $field_id => $normalized_value) { $name = $document->getFieldName($field_id); $index_doc[$name] = $normalized_value; } $native_doc = new Elastica_Document(null, $index_doc); $native_doc->setIndex($this->_activeIndex); $native_doc->setType($collection->getType()); $this->_documents[] = $native_doc; }