Data::SearchEngine::Results::Faceted - Facet role for Results


Data-SearchEngine documentation Contained in the Data-SearchEngine distribution.

Index


Code Index:

NAME

Top

Data::SearchEngine::Results::Faceted - Facet role for Results

SYNOPSIS

Top

    package Data::SeachEngine::Foo;

    with 'Data::SearchEngine::Results::Faceted';

    sub search {
        # do stuff
        $results->set_facet('foo', 'bar');
    }

DESCRIPTION

Top

Provides storage and methods for retrieving facet information.

ATTRIBUTES

Top

facets

HashRef of facets for this query. The HashRef is keyed by the name of the facet and the values are the facet's value.

METHODS

Top

facet_names

Returns an array of all the keys of facets.

Gets the facet with the specified name. Returns undef if one does not exist.

Sets the facet with the specified name.

AUTHOR

Top

Cory G Watson, <gphat at cpan.org>

COPYRIGHT & LICENSE

Top


Data-SearchEngine documentation Contained in the Data-SearchEngine distribution.

package Data::SearchEngine::Results::Faceted;
use Moose::Role;

has facets => (
    traits => [ 'Hash' ],
    is => 'rw',
    isa => 'HashRef[Any]',
    default => sub { {} },
    handles => {
        facet_names=> 'keys',
        get_facet => 'get',
        set_facet => 'set',
    }
);

1;

__END__