/** * @param MetaInformationInterface $meta * * @return Document */ public function createDocument(MetaInformationInterface $meta) { $document = new Document(); $document->setKey(MetaInformationInterface::DOCUMENT_KEY_FIELD_NAME, $meta->getDocumentKey()); $document->setBoost($meta->getBoost()); return $document; }
/** * @param MetaInformationInterface $meta * * @return Document */ public function createDocument(MetaInformationInterface $meta) { $document = new Document(); $document->addField('id', $meta->getEntityId()); $document->addField('document_name_s', $meta->getDocumentName()); $document->setBoost($meta->getBoost()); return $document; }
public function testSetAndGetBoost() { $this->doc->setBoost(2.5); $this->assertEquals(2.5, $this->doc->getBoost()); }
public function testBuildAddXmlSingleDocumentWithBoost() { $doc = new Document(array('id' => 1)); $doc->setBoost(2.5); $command = new AddCommand(); $command->addDocument($doc); $this->assertEquals('<add><doc boost="2.5"><field name="id">1</field></doc></add>', $this->builder->buildAddXml($command)); }