about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiQuery.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-01-15 23:36:23 -1200
committerEric Wong <e@80x24.org>2021-01-18 09:25:32 +0000
commit3863b32ecbfb8af20b6650bd134a251a6b290ec7 (patch)
treefe455e057ef52061963af19e31bb1eee9c7954d0 /lib/PublicInbox/LeiQuery.pm
parent15147f7274c34dd5b177a90e9b6f5e86bc86dee3 (diff)
downloadpublic-inbox-3863b32ecbfb8af20b6650bd134a251a6b290ec7.tar.gz
All the augment and deduplication stuff seems to be working
based on unit tests.  OpPipe is a nice general addition that
will probably make future state machines easier.
Diffstat (limited to 'lib/PublicInbox/LeiQuery.pm')
-rw-r--r--lib/PublicInbox/LeiQuery.pm14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/PublicInbox/LeiQuery.pm b/lib/PublicInbox/LeiQuery.pm
index 69d2f9a6..a80d5887 100644
--- a/lib/PublicInbox/LeiQuery.pm
+++ b/lib/PublicInbox/LeiQuery.pm
@@ -23,8 +23,6 @@ sub _vivify_external { # _externals_each callback
 # the main "lei q SEARCH_TERMS" method
 sub lei_q {
         my ($self, @argv) = @_;
-        my $sto = $self->_lei_store(1);
-        my $cfg = $self->_lei_cfg(1);
         my $opt = $self->{opt};
 
         # --local is enabled by default
@@ -32,7 +30,7 @@ sub lei_q {
         my @srcs;
         require PublicInbox::LeiXSearch;
         require PublicInbox::LeiOverview;
-        require PublicInbox::LeiDedupe;
+        PublicInbox::Config->json;
         my $lxs = PublicInbox::LeiXSearch->new;
 
         # --external is enabled by default, but allow --no-external
@@ -46,10 +44,10 @@ sub lei_q {
         $lxs->wq_workers_start('lei_xsearch', $j, $self->oldset)
                 // $lxs->wq_workers($j);
 
-        unshift(@srcs, $sto->search) if $opt->{'local'};
         # no forking workers after this
-        $self->{ovv} = PublicInbox::LeiOverview->new($self);
-        $self->{dd} = PublicInbox::LeiDedupe->new($self);
+        my $ovv = PublicInbox::LeiOverview->new($self) or return;
+        my $sto = $self->_lei_store(1);
+        unshift(@srcs, $sto->search) if $opt->{'local'};
         my %mset_opt = map { $_ => $opt->{$_} } qw(thread limit offset);
         $mset_opt{asc} = $opt->{'reverse'} ? 1 : 0;
         $mset_opt{qstr} = join(' ', map {;
@@ -69,12 +67,10 @@ sub lei_q {
                         die "unrecognized --sort=$sort\n";
                 }
         }
-        # $self->out($json->encode(\%mset_opt));
         # descending docid order
         $mset_opt{relevance} //= -2 if $opt->{thread};
-        # my $wcb = PublicInbox::LeiToMail->write_cb($out, $self);
         $self->{mset_opt} = \%mset_opt;
-        $self->{ovv}->ovv_begin($self);
+        $ovv->ovv_begin($self);
         $lxs->do_query($self, \@srcs);
 }