+sub index_xap_only { # git->cat_async callback
+ my ($bref, $oid, $type, $size, $smsg) = @_;
+ my $self = $smsg->{self};
+ my $idx = idx_shard($self, $smsg->{num});
+ $smsg->{raw_bytes} = $size;
+ $idx->index_raw($bref, undef, $smsg);
+ $self->{transact_bytes} += $size;
+}
+
+sub index_xap_step ($$$;$) {
+ my ($self, $sync, $beg, $step) = @_;
+ my $end = $sync->{art_end};
+ return if $beg > $end; # nothing to do
+
+ $step //= $self->{shards};
+ my $ibx = $self->{ibx};
+ if (my $pr = $sync->{-opt}->{-progress}) {
+ $pr->("Xapian indexlevel=$ibx->{indexlevel} ".
+ "$beg..$end (% $step)\n");
+ }
+ for (my $num = $beg; $num <= $end; $num += $step) {
+ last if $sync->{quit};
+ my $smsg = $ibx->over->get_art($num) or next;
+ $smsg->{self} = $self;
+ $ibx->git->cat_async($smsg->{blob}, \&index_xap_only, $smsg);
+ if ($self->{transact_bytes} >= $self->{batch_bytes}) {
+ ${$sync->{nr}} = $num;
+ reindex_checkpoint($self, $sync);
+ }
+ }
+}