From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS6315 166.70.0.0/16 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_LOW,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.1 Received: from out03.mta.xmission.com (out03.mta.xmission.com [166.70.13.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id BC0F31F597; Wed, 18 Jul 2018 16:00:16 +0000 (UTC) Received: from in01.mta.xmission.com ([166.70.13.51]) by out03.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1ffosA-0004wY-VN; Wed, 18 Jul 2018 10:00:15 -0600 Received: from [97.119.167.31] (helo=x220.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1ffos9-0002Ys-MA; Wed, 18 Jul 2018 10:00:14 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Eric Wong Cc: meta@public-inbox.org References: <87a7qpjve8.fsf@xmission.com> <20180717233058.30820-3-ebiederm@xmission.com> <20180718102233.jt4loti4k3x3wkp7@whir> Date: Wed, 18 Jul 2018 11:00:07 -0500 In-Reply-To: <20180718102233.jt4loti4k3x3wkp7@whir> (Eric Wong's message of "Wed, 18 Jul 2018 10:22:33 +0000") Message-ID: <87bmb4ilfc.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1ffos9-0002Ys-MA;;;mid=<87bmb4ilfc.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=97.119.167.31;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1/bivpBTQbXmpu09pP61lrU/RoS4VqqBaY= X-SA-Exim-Connect-IP: 97.119.167.31 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: Re: [PATCH 3/3] SearchIdx: Allow the amount of indexing be configured X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) List-Id: Eric Wong writes: > "Eric W. Biederman" wrote: >> This adds a new inbox configuration option 'indexlevel' that can take >> the values 'positions', 'terms', and 'over'. > > The names of these user-facing configuration variables aren't > obviously "levels" at all; especially to people not familiar > with Xapian or public-inbox internals. > > As for "over", at least it should be spelled out "overview"; > but really, I would much prefer something which wouldn't require > consulting the manual for explanations, such as: > > 'full', 'medium', 'minimal' Do you mind the config option name indexlevel? I don't mind changing the names I just needed some name and those names were present. > Where it's obvious which one sits relative to the others. > > That wouldn't tie our user-facing configuration to our internal > choices or terminology used by Xapian, either. I'm pretty happy > with Xapian; but it may be worth exploring other search engines > at some point... > >> --- a/lib/PublicInbox/SearchIdx.pm >> +++ b/lib/PublicInbox/SearchIdx.pm >> @@ -47,6 +47,7 @@ sub git_unquote ($) { >> >> sub new { >> my ($class, $ibx, $creat, $part) = @_; >> + my $levels = qr/(positions|terms|over)/; > > Please anchor matches so they match expected strings exactly. > It lets typos be caught and makes life easier for 3rd-party > tools and implementations if we're stricter in what we accept. > Captures aren't necessary, so '?:' can be used: > > qr/\A(?:full|medium|minimal)\z/ > > Same comment applies to patch 2/3 Good point. I wish I knew a way so I didn't have to repeat the test so often. But getting the user space interface correct is the first step then we can optimize if need be. Eric