private function _readPre21SegmentsFile()
    {
        $segmentsFile = $this->_directory->getFileObject('segments');

        $format = $segmentsFile->readInt();

        if ($format != (int)0xFFFFFFFF) {
            include_once 'Zend/Search/Lucene/Exception.php';
            throw new Zend_Search_Lucene_Exception('Wrong segments file format');
        }

        // read version
        $segmentsFile->readLong();

        // read segment name counter
        $segmentsFile->readInt();

        $segments = $segmentsFile->readInt();

        $this->_docCount = 0;

        // read segmentInfos
        for ($count = 0; $count < $segments; $count++) {
            $segName = $segmentsFile->readString();
            $segSize = $segmentsFile->readInt();
            $this->_docCount += $segSize;

            $this->_segmentInfos[$segName] =
                                new Zend_Search_Lucene_Index_SegmentInfo(
                                    $this->_directory,
                                    $segName,
                                    $segSize
                                );
        }

        // Use 2.1 as a target version. Index will be reorganized at update time.
        $this->_formatVersion = self::FORMAT_2_1;
    }
private function _readPre21SegmentsFile()
    {
        $segmentsFile = $this->_directory->getFileObject('segments');

        $format = $segmentsFile->readInt();

        if ($format != (int)0xFFFFFFFF) {
            include_once 'Zend/Search/Lucene/Exception.php';
            throw new Zend_Search_Lucene_Exception('Wrong segments file format');
        }

        // read version
        $segmentsFile->readLong();

        // read segment name counter
        $segmentsFile->readInt();

        $segments = $segmentsFile->readInt();

        $this->_docCount = 0;

        // read segmentInfos
        for ($count = 0; $count < $segments; $count++) {
            $segName = $segmentsFile->readString();
            $segSize = $segmentsFile->readInt();
            $this->_docCount += $segSize;

            $this->_segmentInfos[$segName] =
                                new Zend_Search_Lucene_Index_SegmentInfo(
                                    $this->_directory,
                                    $segName,
                                    $segSize
                                );
        }

        // Use 2.1 as a target version. Index will be reorganized at update time.
        $this->_formatVersion = self::FORMAT_2_1;
    }
private function _readPre21SegmentsFile ( ) { $ segmentsFile = $ this -> _directory -> getFileObject ( 'segments' ) ; $ format = $ segmentsFile -> readInt ( ) ; if ( $ format != ( int ) 0xFFFFFFFF ) { include_once 'Zend/Search/Lucene/Exception.php' ; throw new Zend_Search_Lucene_Exception ( 'Wrong segments file format' ) ; } // read version $ segmentsFile -> readLong ( ) ; // read segment name counter $ segmentsFile -> readInt ( ) ; $ segments = $ segmentsFile -> readInt ( ) ; $ this -> _docCount = 0 ; // read segmentInfos for ( $ count = 0 ; $ count < $ segments ; $ count ++ ) { $ segName = $ segmentsFile -> readString ( ) ; $ segSize = $ segmentsFile -> readInt ( ) ; $ this -> _docCount += $ segSize ; $ this -> _segmentInfos [ $ segName ] = new Zend_Search_Lucene_Index_SegmentInfo ( $ this -> _directory , $ segName , $ segSize ) ; } // Use 2.1 as a target version. Index will be reorganized at update time. $ this -> _formatVersion = self :: FORMAT_2_1 ; }
Read segments file for pre-2.1 Lucene index format

@throws Zend_Search_Lucene_Exception
Read segments file for pre - 2 . 1 Lucene index format