# phpman > perldoc > Plucene::QueryParser

## NAME
    [Plucene::QueryParser](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AQueryParser/markdown) - Turn query strings into [Plucene::Search::Query](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3ASearch%3A%3AQuery/markdown) objects

## SYNOPSIS
            my $p = [Plucene::QueryParser](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AQueryParser/markdown)->new({
                    analyzer => [Plucene::Analysis::Analyzer](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AAnalysis%3A%3AAnalyzer/markdown) $a,
                    default  => "text"
            });

            my [Plucene::Search::Query](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3ASearch%3A%3AQuery/markdown) $q = $p->parse("foo bar:baz");

## DESCRIPTION
    This module is responsible for turning a query string into a [Plucene::Query](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AQuery/markdown) object. It needs to
    have an Analyzer object to help it tokenize incoming queries, and it also needs to know the
    default field to be used if no field is given in the query string.

## METHODS
  new
            my $p = [Plucene::QueryParser](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AQueryParser/markdown)->new({
                    analyzer => [Plucene::Analysis::Analyzer](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3AAnalysis%3A%3AAnalyzer/markdown) $a,
                    default  => "text"
            });

    Construct a new query parser

  parse
            my [Plucene::Search::Query](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3ASearch%3A%3AQuery/markdown) $q = $p->parse("foo bar:baz");

    Turns the string into a query object.

