* [WIP] search: disable batching in newer versions of Xapian, for now
@ 2016-08-05 11:21 Eric Wong
2016-08-05 11:26 ` Eric Wong
0 siblings, 1 reply; 2+ messages in thread
From: Eric Wong @ 2016-08-05 11:21 UTC (permalink / raw)
To: meta
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [WIP] search: disable batching in newer versions of Xapian, for now
2016-08-05 11:21 [WIP] search: disable batching in newer versions of Xapian, for now Eric Wong
@ 2016-08-05 11:26 ` Eric Wong
0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2016-08-05 11:26 UTC (permalink / raw)
To: meta
Eric Wong <e@80x24.org> wrote:
> $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
if ($v >= 0x1222) { # >= 1.2.22
Meh, I need sleep, this workaround is bogus even with the above
fix.
> + warn "batch size unsupported in ",
> + $Search::Xapian::VERSION, "\n";
> + $self->{batch_size} = undef;
> + }
> +
> $flag = Search::Xapian::DB_CREATE_OR_OPEN;
> _lock_acquire($self);
> }
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-08-05 11:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-05 11:21 [WIP] search: disable batching in newer versions of Xapian, for now Eric Wong
2016-08-05 11:26 ` Eric Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).