Skip to content

Commit

Permalink
avoid ESXM for raw scroll in latest script
Browse files Browse the repository at this point in the history
ElasticSearchX::Model can interfere with queries using sort => _doc,
making them much slower than they should be. There is no need for ESXM
for raw results, so switch to using Search::Elasticsearch directly.
  • Loading branch information
haarg committed Oct 1, 2024
1 parent 6a50825 commit c1b3528
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/MetaCPAN/Script/Latest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,16 @@ sub run {
'Searching for ' . @$filter . ' of ' . $total . ' modules'
}
if @module_filters > 1;
my $scroll = $self->index->type('file')->query($query)->source( [ qw(
author date distribution download_url module.name release status
) ] )->size(100)->raw->scroll;
my $scroll = $self->es->scroll_helper( {
index => $self->index->name,
type => 'file',
size => 100,
body => {
_source => [
qw(author date distribution download_url module.name release status)
],
},
} );

$found_total += $scroll->total;

Expand Down

0 comments on commit c1b3528

Please sign in to comment.