]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei q: enable expensive Xapian flags
authorEric Wong <e@80x24.org>
Tue, 26 Oct 2021 10:35:52 +0000 (10:35 +0000)
committerEric Wong <e@80x24.org>
Tue, 26 Oct 2021 17:43:53 +0000 (17:43 +0000)
FLAG_PURE_NOT is too expensive for public-facing WWW use, but
lei isn't public-facing.  We'll also unconditionally enable
phrase search on old "chert" DBs since lei doesn't need to
worry about fairness across 10K users.

lib/PublicInbox/LeiSearch.pm

index 1fb38da1d7aaac22d7f9475cb342a4cdb4e0b3e4..d0ca13f0aa11e444b2fc5292b927dbc777b0a677 100644 (file)
@@ -175,6 +175,8 @@ sub all_terms {
 sub qparse_new {
        my ($self) = @_;
        my $qp = $self->SUPER::qparse_new; # PublicInbox::Search
+       $self->{qp_flags} |= PublicInbox::Search::FLAG_PHRASE() |
+                               PublicInbox::Search::FLAG_PURE_NOT();
        $qp->add_boolean_prefix('kw', 'K');
        $qp->add_boolean_prefix('L', 'L');
        $qp