From 80b887f29b2ec71d025b4c266a1c26314758994c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 2 Sep 2020 11:04:16 +0000 Subject: search: replace ->query with ->mset Nearly all of the search uses in the production code rely on a Xapian mset iterator being returned (instead of an array of $smsg objects). So default to returning the mset and move the burden of smsg array conversion into the test cases. --- lib/PublicInbox/SolverGit.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/PublicInbox/SolverGit.pm') diff --git a/lib/PublicInbox/SolverGit.pm b/lib/PublicInbox/SolverGit.pm index ddf5fa16..ff8a4946 100644 --- a/lib/PublicInbox/SolverGit.pm +++ b/lib/PublicInbox/SolverGit.pm @@ -229,10 +229,9 @@ sub find_extract_diffs ($$$) { } } - my $msgs = $srch->query($q, { relevance => 1 }); - + my $mset = $srch->mset($q, { relevance => 1 }); my $diffs = []; - foreach my $smsg (@$msgs) { + for my $smsg (@{$srch->mset_to_smsg($ibx, $mset)}) { my $eml = $ibx->smsg_eml($smsg) or next; $eml->each_part(\&extract_diff, [$self, $diffs, $pre, $post, $ibx, $smsg], 1); -- cgit v1.2.3-24-ge0c7