private function _hasAnythingToMerge()
    {
        $segmentSizes = array();
        foreach ($this->_segmentInfos as $segName => $segmentInfo) {
            $segmentSizes[$segName] = $segmentInfo->count();
        }

        $mergePool   = array();
        $poolSize    = 0;
        $sizeToMerge = $this->maxBufferedDocs;
        asort($segmentSizes, SORT_NUMERIC);
        foreach ($segmentSizes as $segName => $size) {
            // Check, if segment comes into a new merging block
            while ($size >= $sizeToMerge) {
                // Merge previous block if it's large enough
                if ($poolSize >= $sizeToMerge) {
                    return true;
                }
                $mergePool   = array();
                $poolSize    = 0;

                $sizeToMerge *= $this->mergeFactor;

                if ($sizeToMerge > $this->maxMergeDocs) {
                    return false;
                }
            }

            $mergePool[] = $this->_segmentInfos[$segName];
            $poolSize += $size;
        }

        if ($poolSize >= $sizeToMerge) {
            return true;
        }

        return false;
    }
private function _hasAnythingToMerge()
    {
        $segmentSizes = array();
        foreach ($this->_segmentInfos as $segName => $segmentInfo) {
            $segmentSizes[$segName] = $segmentInfo->count();
        }

        $mergePool   = array();
        $poolSize    = 0;
        $sizeToMerge = $this->maxBufferedDocs;
        asort($segmentSizes, SORT_NUMERIC);
        foreach ($segmentSizes as $segName => $size) {
            // Check, if segment comes into a new merging block
            while ($size >= $sizeToMerge) {
                // Merge previous block if it's large enough
                if ($poolSize >= $sizeToMerge) {
                    return true;
                }
                $mergePool   = array();
                $poolSize    = 0;

                $sizeToMerge *= $this->mergeFactor;

                if ($sizeToMerge > $this->maxMergeDocs) {
                    return false;
                }
            }

            $mergePool[] = $this->_segmentInfos[$segName];
            $poolSize += $size;
        }

        if ($poolSize >= $sizeToMerge) {
            return true;
        }

        return false;
    }
private function _hasAnythingToMerge ( ) { $ segmentSizes = array ( ) ; foreach ( $ this -> _segmentInfos as $ segName => $ segmentInfo ) { $ segmentSizes [ $ segName ] = $ segmentInfo -> count ( ) ; } $ mergePool = array ( ) ; $ poolSize = 0 ; $ sizeToMerge = $ this -> maxBufferedDocs ; asort ( $ segmentSizes , SORT_NUMERIC ) ; foreach ( $ segmentSizes as $ segName => $ size ) { // Check, if segment comes into a new merging block while ( $ size >= $ sizeToMerge ) { // Merge previous block if it's large enough if ( $ poolSize >= $ sizeToMerge ) { return true ; } $ mergePool = array ( ) ; $ poolSize = 0 ; $ sizeToMerge *= $ this -> mergeFactor ; if ( $ sizeToMerge > $ this -> maxMergeDocs ) { return false ; } } $ mergePool [ ] = $ this -> _segmentInfos [ $ segName ] ; $ poolSize += $ size ; } if ( $ poolSize >= $ sizeToMerge ) { return true ; } return false ; }
Check if we have anything to merge

@return boolean
Check if we have anything to merge