/** * Commit changes resulting from delete() or undeleteAll() operations. * * @todo undeleteAll processing. */ public function commit() { if ($this->_hasChanges) { foreach ($this->_segmentInfos as $segInfo) { $segInfo->writeChanges(); } $this->_hasChanges = false; } if ($this->_writer !== null) { $this->_writer->commit(); $this->_updateDocCount(); } }
/** * Commit changes resulting from delete() or undeleteAll() operations. * * @todo delete() and undeleteAll processing. */ public function commit() { if ($this->_writer !== null) { foreach ($this->_writer->commit() as $segmentName => $segmentInfo) { if ($segmentInfo !== null) { $this->_segmentInfos[] = $segmentInfo; $this->_docCount += $segmentInfo->count(); } else { foreach ($this->_segmentInfos as $segId => $segInfo) { if ($segInfo->getName() == $segmentName) { unset($this->_segmentInfos[$segId]); } } } } } }