Elastic::Model::Results::Cached - A cacheable iterator over bounded/finite search results
version 0.50
$cache = CHI->new(...); $view = $model->view ->cache( $cache ) ->cache_opts( expires_in => '30 sec' ); $results = $view->cached_search; $results = $view->cached_search( expires_in => '2 sec', force_set => 1 );
An Elastic::Model::Results::Cached object is returned when you call "cached_search()" in Elastic::Model::View, and behaves exactly the same as Elastic::Model::Results except that it will try to retrieve the results from the cache, before hitting Elasticsearch.
The CHI-compatible cache object from "cache" in Elastic::Model::View.
The combination of the default "cache_opts" in Elastic::Model::View plus any additional options passed in to "cached_search()" in Elastic::Model::View. These options are passed to CHI's get() or set() methods.
The cache_key is a canonical JSON string representation of the full "search" in Elastic::Model::Role::Results parameter.
Clinton Gormley <drtech@cpan.org>
This software is copyright (c) 2014 by Clinton Gormley.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Elastic::Model, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Elastic::Model
CPAN shell
perl -MCPAN -e shell install Elastic::Model
For more information on module installation, please visit the detailed CPAN module installation guide.