diff options
author | Eric Wong <e@80x24.org> | 2018-04-23 05:06:00 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2018-04-23 05:06:18 +0000 |
commit | f826a7830bce67c0f8c653baf97f7769bb2c57d9 (patch) | |
tree | b85e14f5ce815eefd0d7b22a15ee92667e032954 /lib/PublicInbox/Search.pm | |
parent | e68ad2c9d4de7fb8434f01a824564ac61aa48e80 (diff) | |
download | public-inbox-f826a7830bce67c0f8c653baf97f7769bb2c57d9.tar.gz |
Previous search queries already set sort order on the Enquire object, altering the ordering of results and was causing messages to be redundantly downloaded via POST /$INBOX/?q=$QUERY&x=m So stop caching the Search::Xapian::Enquire object since it wasn't providing any measurable performance improvement.
Diffstat (limited to 'lib/PublicInbox/Search.pm')
-rw-r--r-- | lib/PublicInbox/Search.pm | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm index 5aabda02..69eca9fe 100644 --- a/lib/PublicInbox/Search.pm +++ b/lib/PublicInbox/Search.pm @@ -219,14 +219,13 @@ sub _do_enquire { sub _enquire_once { my ($self, $query, $opts) = @_; - my $enquire = enquire($self); + my $enquire = Search::Xapian::Enquire->new($self->{xdb}); $enquire->set_query($query); $opts ||= {}; my $desc = !$opts->{asc}; if (($opts->{mset} || 0) == 2) { $enquire->set_docid_order(Search::Xapian::ENQ_ASCENDING()); $enquire->set_weighting_scheme(Search::Xapian::BoolWeight->new); - delete $self->{enquire}; } elsif ($opts->{relevance}) { $enquire->set_sort_by_relevance_then_value(TS, $desc); } else { @@ -334,11 +333,6 @@ sub subject_normalized { $subj; } -sub enquire { - my ($self) = @_; - $self->{enquire} ||= Search::Xapian::Enquire->new($self->{xdb}); -} - sub help { my ($self) = @_; $self->qp; # parse altids |