lib/Search/Elasticsearch/Client/7_0/Scroll.pm [30:58]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub BUILDARGS {
#===================================
    my ( $class, $params ) = parse_params(@_);
    my $es = delete $params->{es};
    my $scroll = $params->{scroll} ||= '1m';

    my $results      = $es->search($params);

    my $total = $results->{hits}{total};
    if (ref $total) {
        $total = $total->{value}
    }

    return {
        es           => $es,
        scroll       => $scroll,
        aggregations => $results->{aggregations},
        facets       => $results->{facets},
        suggest      => $results->{suggest},
        took         => $results->{took},
        total_took   => $results->{took},
        total        => $total,
        max_score    => $results->{hits}{max_score},
        _buffer      => $results->{hits}{hits},
        $total
        ? ( _scroll_id => $results->{_scroll_id} )
        : ( is_finished => 1 )
    };
}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



lib/Search/Elasticsearch/Client/8_0/Scroll.pm [30:58]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub BUILDARGS {
#===================================
    my ( $class, $params ) = parse_params(@_);
    my $es = delete $params->{es};
    my $scroll = $params->{scroll} ||= '1m';

    my $results      = $es->search($params);

    my $total = $results->{hits}{total};
    if (ref $total) {
        $total = $total->{value}
    }

    return {
        es           => $es,
        scroll       => $scroll,
        aggregations => $results->{aggregations},
        facets       => $results->{facets},
        suggest      => $results->{suggest},
        took         => $results->{took},
        total_took   => $results->{took},
        total        => $total,
        max_score    => $results->{hits}{max_score},
        _buffer      => $results->{hits}{hits},
        $total
        ? ( _scroll_id => $results->{_scroll_id} )
        : ( is_finished => 1 )
    };
}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



