From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id D728D2018E for ; Fri, 5 Aug 2016 11:21:45 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [WIP] search: disable batching in newer versions of Xapian, for now Date: Fri, 5 Aug 2016 11:21:45 +0000 Message-Id: <20160805112145.19998-1-e@80x24.org> List-Id: This warrants further investigation... --- lib/PublicInbox/SearchIdx.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index f8249c5..114ff9e 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -43,6 +43,17 @@ sub new { require File::Path; File::Path::mkpath($dir); $self->{batch_size} = 100; + + # XXX temporary hack... + my $v = ((Search::Xapian::major_version << 16) | + (Search::Xapian::minor_version << 8 ) | + Search::Xapian::revision()); + if ($v >= 0x10222) { # >= 1.2.22 + warn "batch size unsupported in ", + $Search::Xapian::VERSION, "\n"; + $self->{batch_size} = undef; + } + $flag = Search::Xapian::DB_CREATE_OR_OPEN; _lock_acquire($self); } -- EW