Permalink
Browse files

Removed the to_cache() method from Elastic::Model::Results

  • Loading branch information...
1 parent bba63b5 commit d3e378647d328891621380e0aa920f125d288196 @clintongormley committed Nov 5, 2012
Showing with 0 additions and 28 deletions.
  1. +0 −28 lib/Elastic/Model/Results.pm
@@ -33,21 +33,6 @@ sub BUILD {
$self->_set_took( $result->{took} || 0 );
$self->_set_facets( $result->{facets} || {} );
- #$self->_set_timed_out( !!$result->{timed_out} );
-}
-
-#===================================
-sub to_cache {
-#===================================
- my $self = shift;
- my %data = map { $_ => $self->$_ } qw(search total max_score facets took);
-
- my @elements = @{ $self->elements };
- for (@elements) {
- delete @{$_}{ '_object', '_partial' };
- }
- $data{elements} = \@elements;
- return \%data;
}
1;
@@ -447,16 +432,3 @@ Also C<slice_results>, C<slice_objects>, C<slice_elements>, C<slice_partials>
Returns all L</elements> as a list.
Also C<all_results>, C<all_objects>, C<all_elements>, C<all_partials>
-
-=head1 CACHING RESULTSETS
-
-In a later release, caching of result sets will be integrated into
-Elastic::Model. For now, you can do this yourself with:
-
-To deflate the data for caching:
-
- $data = $results->to_cache;
-
-To reinflate a resultset from raw data:
-
- $results = $model->result_class->new( $data )->as_results

0 comments on commit d3e3786

Please sign in to comment.