Peter Karman > Search-Query > Search::Query::Clause

Download:
Search-Query-0.304.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.304   Source  

NAME ^

Search::Query::Clause - part of a Dialect

SYNOPSIS ^

 my $clause = Search::Query::Clause->new(
    field => 'color',
    op    => '=',
    value => 'green',
 );
 my $query = Search::Query->parser->parse("color=red");
 $query->add_or_clause( $clause );
 print $query; # +color=red color=green

DESCRIPTION ^

A Clause object represents a leaf in a Query Dialect tree.

METHODS ^

This class is a subclass of Rose::ObjectX::CAF. Only new or overridden methods are documented here.

field

op

value

quote

proximity

is_tree

Returns true if the Clause has child Clauses.

has_children

Returns the number of child Clauses if is_tree() is true.

Returns undef if is_tree() is false.

stringify

Returns Clause as a string. Like Dialect, string-like operators are overloaded to call stringify().

NOTE that stringify() is not necessarily called by the parent Dialect object when the Dialect object is stringifying itself.

AUTHOR ^

Peter Karman, <karman at cpan.org>

BUGS ^

Please report any bugs or feature requests to bug-search-query at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Search-Query. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc Search::Query

You can also look for information at:

ACKNOWLEDGEMENTS ^

This module started as a fork of Search::QueryParser by Laurent Dami.

COPYRIGHT & LICENSE ^

Copyright 2010 Peter Karman.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

syntax highlighting: