Data::AnyXfer::Elastic::ScrollHelper - ScrollHelper for ES
A wrapper around Search::Elasticsearch::Scroll instance for ES search, for scrolling through batches of ES results.
Search::Elasticsearch::Scroll
use Data::AnyXfer::Elastic::ScrollHelper; my $scroll_helper = Data::AnyXfer::Elastic::ScrollHelper->new( extract_results => $extract_results, scroll_helper => $self->es->scroll_helper, ); while (my $result = $scroll_helper->next) { ... }
scroll_helper
The instance of Search::Elasticsearch::Scroll from the ES search. Required.
extract_results
Should the results be extracted? Changes the results returned by "next" in . and "drain_buffer" in ..
next
while (my $result = $scroll_helper->next) { ... }
Fetch the next result from ES buffer - fetching more results if required. Returns empty list when there are no more results.
If "extract_results" in . is true then the results are extracted from _source.
_source
drain_buffer
while ($scroll_helper->refill_buffer) { my @results = $scroll_helper->drain_buffer; ... }
Empties the buffer and returts a list of results from it.
This software is copyright (c) 2019, Anthony Lucas.
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 Data::AnyXfer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::AnyXfer
CPAN shell
perl -MCPAN -e shell install Data::AnyXfer
For more information on module installation, please visit the detailed CPAN module installation guide.