# phpman > perldoc > Plucene::Index::FieldsReader

## NAME
    [Plucene::Index::FieldsReader](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AIndex%3A%3AFieldsReader/markdown) - read Fields in a Document

## SYNOPSIS
            my $reader = [Plucene::Index::FieldsReader](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AIndex%3A%3AFieldsReader/markdown)->new(
                    $dir_name, $segment, $field_infos);

            my [Plucene::Document](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3ADocument/markdown) $doc = $reader->doc($offset);

            my $size = $reader->size;

## DESCRIPTION
    This class gives access to documents within the index.

## METHODS
  new
            my $reader = [Plucene::Index::FieldsReader](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AIndex%3A%3AFieldsReader/markdown)->new(
                    $dir_name, $segment, $field_infos);

    This will create a new [Plucene::Index::FieldsReader](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AIndex%3A%3AFieldsReader/markdown) with the passed in directory name, segment
    and field infos.

  size
            my $size = $reader->size;

    This returns the size.

  doc
            my [Plucene::Document](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3ADocument/markdown) $doc = $reader->doc($offset);

    This will return the [Plucene::Document](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3ADocument/markdown) object found at the passed in position.

