Pangloss::Search - search through Pangloss Terms.


Pangloss documentation  | view source Contained in the Pangloss distribution.

Index


NAME

Top

Pangloss::Search - search through Pangloss Terms.

SYNOPSIS

Top

  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

Top

Search through a collection of Pangloss::Terms.

METHODS

Top

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

Top

Steve Purkis <spurkis@quiup.com>

SEE ALSO

Top

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


Pangloss documentation  | view source Contained in the Pangloss distribution.