Steve Purkis > Pangloss-0.06 > Pangloss::Search

Download:
Pangloss-0.06.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source  

NAME ^

Pangloss::Search - search through Pangloss Terms.

SYNOPSIS ^

  use Pangloss::Search;
  my $search = new Pangloss::Search;

  $search->terms( $terms->clone )
         ->categories( $categories )
         ->concepts( $concepts )
         ->languages( $languages )
         ->users( $users );

  $search->add_filters( @filters );

  $search->apply;

  $results = $search->results;

DESCRIPTION ^

Search through a collection of Pangloss::Terms.

METHODS ^

TODO: document other API methods.

Note: the $obj->terms collection gets modified, so you should consider cloning it before handing it over... individual terms that end up in the result set are cloned, so you don't have to worry about doing a deep_clone().

$obj = $obj->apply( [ $mode ] )

Applies the filters to the Pangloss::Terms, and returns this object. Results are accessible via $obj->results() (a Pangloss::Search::Results object).

The results will contain all terms that match the filters (ie: those where $filter->applies_to( $term ) evaluates to true).

The $mode argument is a set-theory switch that affects how terms will be added to the result set. It defaults to 'intersect', but may also be set to 'union'.

Note that collection of terms will be modified - this means you should give a shallow copy of the terms to search objects.

AUTHOR ^

Steve Purkis <spurkis@quiup.com>

SEE ALSO ^

Pangloss, Pangloss::Search::Request, Pangloss::Search::Results, Pangloss::Search::Filters,

syntax highlighting: