# phpman > perldoc > Plucene::Index::TermInfosWriter

## NAME
    [Plucene::Index::TermInfosWriter](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AIndex%3A%3ATermInfosWriter/markdown) - write to the term infos file

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

            $writer->add([Plucene::Index::Term](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AIndex%3A%3ATerm/markdown) $term,
                            [Plucene::Index::TermInfo](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AIndex%3A%3ATermInfo/markdown) $term_info);

            $writer->write_term([Plucene::Index::Term](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AIndex%3A%3ATerm/markdown) $term);

## DESCRIPTION
    This will allow for the writing and adding to a term infos file for a particular segment. It
    also writes the term infos index.

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

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

  break_ref
    This will break a circular reference.

  add
            $writer->add([Plucene::Index::Term](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AIndex%3A%3ATerm/markdown) $term,
                            [Plucene::Index::TermInfo](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AIndex%3A%3ATermInfo/markdown) $term_info);

    This will add the term and term info to the term infos file.

  write_term
            $writer->write_term([Plucene::Index::Term](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AIndex%3A%3ATerm/markdown) $term);

    This will write the term to the term infos file.

