"Eric W. Biederman" <[email protected]> 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'

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
--
unsubscribe: [email protected]
archive: https://public-inbox.org/meta/

Reply via email to