'; return $this->_sendRawPost($this->_updateUrl, $rawPost, $timeout); } /** * @inheritdoc * @see Solr4Service_Core::addDocuments */ public function addDocument(Apache_Solr_Document $document, $allowDups = false, $overwritePending = true, $overwriteCommitted = true, $commitWithin = 0 ) { return $this->addDocuments(array($document), $allowDups, $overwritePending, $overwriteCommitted, $commitWithin); } /** * Solr 4.0 compat http://wiki.apache.org/solr/UpdateXmlMessages#Optional_attributes_for_.22add.22 * Remove allowDups, overwritePending and overwriteComitted */ public function addDocuments($documents, $allowDups = false, $overwritePending = true, $overwriteCommitted = true, $commitWithin = 0 ) { $overwriteVal = $allowDups ? 'false' : 'true'; $commitWithin = (int) $commitWithin; $commitWithinString = $commitWithin > 0 ? " commitWithin=\"{$commitWithin}\"" : ''; $rawPost = ""; foreach ($documents as $document) { if ($document instanceof Apache_Solr_Document) { $rawPost .= $this->_documentToXmlFragment($document); } } $rawPost .= ''; return $this->add($rawPost); } }