# Plucene::Index::SegmentInfos - A collection of SegmentInfo objects - perldoc - [phpMan]

## NAME
    [Plucene::Index::SegmentInfos](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AIndex%3A%3ASegmentInfos/markdown) - A collection of SegmentInfo objects

## SYNOPSIS
            my $segmentinfos = [Plucene::Index::SegmentInfos](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AIndex%3A%3ASegmentInfos/markdown)->new;

            $segmentinfos->read($dir);
            $segmentinfos->write($dir);

            $segmentinfos->add_element([Plucene::Index::SegmentInfo](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AIndex%3A%3ASegmentInfo/markdown) $segment_info);

            my [Plucene::Index::SegmentInfo](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AIndex%3A%3ASegmentInfo/markdown) @segment_info
                    = $segmentinfos->segments;

## DESCRIPTION
    This is a collection of [Plucene::Index::SegmentInfo](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AIndex%3A%3ASegmentInfo/markdown) objects

## METHODS
  new
            my $segmentinfos = [Plucene::Index::SegmentInfos](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AIndex%3A%3ASegmentInfos/markdown)->new;

    This will create a new (empty) [Plucene::Index::SegmentInfos](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AIndex%3A%3ASegmentInfos/markdown) object.

  read
            $segmentinfos->read($dir);

    This will read the segments file from the passed directory.

  write
            $segmentinfos->write($dir);

    This will write the segments info file out.

  add_element
            $segmentinfos->add_element([Plucene::Index::SegmentInfo](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AIndex%3A%3ASegmentInfo/markdown) $segment_info);

    This will add the passed [Plucene::Index::SegmentInfo](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AIndex%3A%3ASegmentInfo/markdown) object..

  info
            my [Plucene::Index::SegmentInfo](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AIndex%3A%3ASegmentInfo/markdown) $info
                    = $segmentinfos->info($segment_no);

    This will return the [Plucene::Index::SegmentInfo](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AIndex%3A%3ASegmentInfo/markdown) object at the passed segment number.

  segments
            my [Plucene::Index::SegmentInfo](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AIndex%3A%3ASegmentInfo/markdown) @segment_info
                    = $segmentinfos->segments;

    This returns all the [Plucene::Index::SegmentInfo](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AIndex%3A%3ASegmentInfo/markdown) onjects in this segment.

